Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
supersonicAI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dmath010
supersonicAI
Commits
5cee743f
Commit
5cee743f
authored
7 years ago
by
Vicki Pfau
Browse files
Options
Downloads
Patches
Plain Diff
scripts: Add steamcmd download script
parent
5c92c2ea
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/import_sega_classics.py
+44
-0
44 additions, 0 deletions
scripts/import_sega_classics.py
with
44 additions
and
0 deletions
scripts/import_sega_classics.py
0 → 100755
+
44
−
0
View file @
5cee743f
#!/usr/bin/env python
import
getpass
import
io
import
os
import
requests
import
retro.data
import
subprocess
import
sys
import
tarfile
import
tempfile
username
=
input
(
'
Username:
'
)
password
=
getpass
.
getpass
(
'
Password (leave blank if cached):
'
)
if
password
:
password
=
password
+
'
\n
'
authcode
=
input
(
'
Steam Guard code (leave blank if unknown):
'
)
if
authcode
:
password
=
password
+
authcode
+
'
\n
'
with
tempfile
.
TemporaryDirectory
()
as
dir
:
if
sys
.
platform
.
startswith
(
'
linux
'
):
r
=
requests
.
get
(
'
https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
'
)
elif
sys
.
platform
.
startswith
(
'
darwin
'
):
r
=
requests
.
get
(
'
https://steamcdn-a.akamaihd.net/client/installer/steamcmd_osx.tar.gz
'
)
else
:
raise
RuntimeError
(
'
Unknown platform %s
'
%
sys
.
platform
)
tarball
=
tarfile
.
open
(
fileobj
=
io
.
BytesIO
(
r
.
content
))
tarball
.
extractall
(
dir
)
command
=
[
'
%s/steamcmd.sh
'
%
dir
,
'
+login
'
,
username
,
'
+force_install_dir
'
,
dir
,
'
+@sSteamCmdForcePlatformType
'
,
'
windows
'
,
'
+app_update
'
,
'
34270
'
,
'
validate
'
,
'
+quit
'
]
print
(
'
Downloading ROMs...
'
)
subprocess
.
run
(
command
,
check
=
True
,
input
=
password
.
encode
(
'
utf-8
'
),
stdout
=
subprocess
.
DEVNULL
)
romdir
=
os
.
path
.
join
(
dir
,
'
uncompressed ROMs
'
)
roms
=
[
os
.
path
.
join
(
romdir
,
rom
)
for
rom
in
os
.
listdir
(
romdir
)]
retro
.
data
.
merge
(
*
roms
,
quiet
=
False
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment