-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrom_downloader.ps1
173 lines (156 loc) · 4.02 KB
/
rom_downloader.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
param (
[string]$console = "nintendo-64",
[string]$folder = "$HOME\Desktop\roms\$console\"
)
$found_games = @()
$found_games_links = @()
$counter = 0
$loop = $true
$save_file = ""
$wc = New-Object System.Net.WebClient
Write-Host `n "gathering Roms and Preparing Download... This can take some minutes" `n
for($i=0; $loop -eq $true; $i++)
{
$path = "https://romsmode.com/roms/" + $console + "/" + $i + "?genre=&name=®ion="
try{
$found_games += ((Invoke-WebRequest -Uri $path).links | Where-Object {$_.href -match "\d{6,6}"}).innerHTML
$found_games_links += ((Invoke-WebRequest -Uri $path).links | Where-Object {$_.href -match "\d{6,6}"}).href
}
catch{
$loop = $false
}
}
$found_games_links = $found_games_links.Replace("https://romsmode.com/", "https://romsmode.com/download/") | select -Unique
$found_games_count = ($found_games_links).count
Write-Host -Separator "`n" $found_games | select -Unique
Write-Host `n "Prepared Roms for Download: " $found_games_count `n
Write-Host "need help? get-Help rom_downloader.ps1"
If(!(Test-Path $folder))
{
New-Item -ItemType Directory -Force -Path $folder
}
$found_games_links | ForEach-Object {
$game_link_name = $_.Split("/")
$game_download = ((Invoke-WebRequest -Uri $_).links | Where-Object {$_.class -eq "wait__link"}).href
$save_file = $folder + $game_link_name[6] + ".zip"
Write-Progress -Activity "Downloading: $($game_link_name[6])" -Status "$counter/$found_games_count complete" -PercentComplete (((100 / $found_games_count) * $counter))
$wc.DownloadFile($game_download, $save_file)
$counter++
}
<#
.SYNOPSIS
Script to Download roms from romsmode.com.
.DESCRIPTION
This Script downloads Roms by your choices.
Downloadpath = Desktop\rom_games\
.PARAMETER console
gameboy,acorn-8-bit
acorn-archimedes
acorn-electron
amiga-500
amstrad-cpc
amstrad-gx4000
apple-i
apple-ii
apple-ii-gs
atari-2600
atari-5200
atari-7800
atari-800
atari-jaguar
atari-lynx
atari-st
bally-pro-arcade-astrocade
bbc-micro
camputers-lynx
capcom-play-system-1
capcom-play-system-2
casio-loopy
casio-pv1000
colecovision
colecovision-adam
commodore-64
commodore-max-machine
commodore-pet
commodore-plus4-c16
commodore-vic20
dragon-data-dragon
elektronika-bk
emerson-arcadia-2001
entex-adventure-vision
epoch-super-cassette-vision
fairchild-channel-f
funtech-super-acan
galaksija
game-gear
gameboy
gameboy-advance
gameboy-color
gamecube
gamepark-gp32
gce-vectrex
hartung-game-master
intellivision
interact-family-computer
kaypro-ii
luxor-abc-800
magnavox-odyssey-2
mame
mattel-aquarius
memotech-mtx512
miles-gordon-sam-coupe
msx-2
msx-computer
neo-geo
neo-geo-pocket
neo-geo-pocket-color
nintendo
nintendo-3ds
nintendo-64
nintendo-ds
nintendo-famicom-disk-system
nintendo-pokemon-mini
nintendo-virtual-boy
nintendo-wii
nokia-n-gage
pel-varazdin-orao
philips-videopac
playstation
playstation-2
playstation-portable
rca-studio-ii
robotron-z1013
sega-32x
dreamcast
sega-genesis
sega-master-system
sega-pico
sega-sg1000
sega-super-control-station
sega-visual-memory-system
sharp-mz-700
sharp-x68000
sinclair-zx81
sufami-turbo
super-grafx
super-nintendo
tandy-color-computer
tangerine-oric
thomson-mo5
tiger-game-com
turbografx-16
vtech-creativision
vtech-v-smile
wang-vs
watara-supervision
wonderswan
microsoft-xbox
z-machine-infocom
zx-spectrum
.PARAMETER folder
Path of the destination folder (e.g. D
.EXAMPLE
rom_downloader.ps1 -console gameboy
.EXAMPLE
rom_downloader.ps1 -console commodore-64
#>