-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetch_flags.py
executable file
·281 lines (277 loc) · 18 KB
/
fetch_flags.py
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
#!/usr/bin/python
import urllib
'''
\\ urls and codes were retreived by this Javascript:
$(".wikitable.sortable.jquery-tablesorter:first td:first-child").map(function(i, e) { return $(e).text()});
$("img.thumbborder").map(function(i, e) { return $(e).attr('src')});
\\ from wiki pages like: http://en.wikipedia.org/wiki/ISO_3166-2:ES
'''
codes = [
"AT-BU",
"AT-KA",
"AT-NO",
"AT-OO",
"AT-SZ",
"AT-ST",
"AT-TR",
"AT-VO",
"AT-WI",
"DE-BW",
"DE-BY",
"DE-BE",
"DE-BB",
"DE-HB",
"DE-HH",
"DE-HE",
"DE-MV",
"DE-NI",
"DE-NW",
"DE-RP",
"DE-SL",
"DE-SN",
"DE-ST",
"DE-SH",
"DE-TH",
"CA-AB",
"CA-BC",
"CA-MB",
"CA-NB",
"CA-NL",
"CA-NS",
"CA-ON",
"CA-PE",
"CA-QC",
"CA-SK",
"CA-NT",
"CA-NU",
"CA-YT",
"CZ-JC",
"CZ-JM",
"CZ-KA",
"CZ-KR",
"CZ-LI",
"CZ-MO",
"CZ-OL",
"CZ-PA",
"CZ-PL",
"CZ-PR",
"CZ-ST",
"CZ-US",
"CZ-VY",
"CZ-ZL",
"AU-NS",
"AU-QL",
"AU-SA",
"AU-TS",
"AU-VI",
"AU-WA",
"AU-CT",
"AU-NT",
"FR-A",
"FR-B",
"FR-C",
"FR-P",
"FR-D",
"FR-E",
"FR-F",
"FR-G",
"FR-H",
"FR-I",
"FR-Q",
"FR-J",
"FR-K",
"FR-L",
"FR-M",
"FR-N",
"FR-O",
"FR-R",
"FR-S",
"FR-T",
"FR-U",
"FR-V",
"IT-65",
"IT-77",
"IT-78",
"IT-72",
"IT-45",
"IT-36",
"IT-62",
"IT-42",
"IT-25",
"IT-57",
"IT-67",
"IT-21",
"IT-75",
"IT-88",
"IT-82",
"IT-52",
"IT-32",
"IT-55",
"IT-23",
"IT-34",
"ES-AN",
"ES-AR",
"ES-AS",
"ES-CN",
"ES-CB",
"ES-CM",
"ES-CL",
"ES-CT",
"ES-EX",
"ES-GA",
"ES-IB",
"ES-RI",
"ES-MD",
"ES-MC",
"ES-NC",
"ES-PV",
"ES-VC",
"ES-CE",
"ES-ML",
"SK-BC",
"SK-BL",
"SK-KI",
"SK-NI",
"SK-PV",
"SK-TC",
"SK-TA",
"SK-ZI",
]
urls = [
"http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Flag_of_Burgenland.svg/22px-Flag_of_Burgenland.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/Flag_of_Carinthia.svg/23px-Flag_of_Carinthia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Flag_of_Lower_Austria.svg/23px-Flag_of_Lower_Austria.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Flag_of_Upper_Austria.svg/23px-Flag_of_Upper_Austria.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Flag_of_Salzburg.svg/23px-Flag_of_Salzburg.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Flag_of_Styria.svg/23px-Flag_of_Styria.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Flag_of_Tirol.svg/23px-Flag_of_Tirol.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Flag_of_Vorarlberg.svg/23px-Flag_of_Vorarlberg.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Flag_of_Wien.svg/23px-Flag_of_Wien.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Flag_of_Baden-W%C3%BCrttemberg.svg/23px-Flag_of_Baden-W%C3%BCrttemberg.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Flag_of_Bavaria_%28lozengy%29.svg/23px-Flag_of_Bavaria_%28lozengy%29.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Flag_of_Berlin.svg/23px-Flag_of_Berlin.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/0/01/Flag_of_Brandenburg.svg/23px-Flag_of_Brandenburg.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Flag_of_Bremen.svg/23px-Flag_of_Bremen.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/7/74/Flag_of_Hamburg.svg/23px-Flag_of_Hamburg.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Flag_of_Hesse.svg/23px-Flag_of_Hesse.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Flag_of_Mecklenburg-Western_Pomerania.svg/23px-Flag_of_Mecklenburg-Western_Pomerania.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/81/Flag_of_Lower_Saxony.svg/23px-Flag_of_Lower_Saxony.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Flag_of_North_Rhine-Westphalia.svg/23px-Flag_of_North_Rhine-Westphalia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/Flag_of_Rhineland-Palatinate.svg/23px-Flag_of_Rhineland-Palatinate.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Flag_of_Saarland.svg/23px-Flag_of_Saarland.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Flag_of_Saxony.svg/23px-Flag_of_Saxony.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Flag_of_Saxony-Anhalt.svg/23px-Flag_of_Saxony-Anhalt.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/Flag_of_Schleswig-Holstein.svg/23px-Flag_of_Schleswig-Holstein.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Flag_of_Thuringia.svg/23px-Flag_of_Thuringia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/Flag_of_Alberta.svg/23px-Flag_of_Alberta.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/Flag_of_British_Columbia.svg/23px-Flag_of_British_Columbia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Manitoba.svg/23px-Flag_of_Manitoba.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/Flag_of_New_Brunswick.svg/23px-Flag_of_New_Brunswick.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Flag_of_Newfoundland_and_Labrador.svg/23px-Flag_of_Newfoundland_and_Labrador.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Flag_of_Nova_Scotia.svg/23px-Flag_of_Nova_Scotia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/88/Flag_of_Ontario.svg/23px-Flag_of_Ontario.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Flag_of_Prince_Edward_Island.svg/23px-Flag_of_Prince_Edward_Island.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Flag_of_Quebec.svg/23px-Flag_of_Quebec.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/Flag_of_Saskatchewan.svg/23px-Flag_of_Saskatchewan.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Flag_of_the_Northwest_Territories.svg/23px-Flag_of_the_Northwest_Territories.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/Flag_of_Nunavut.svg/23px-Flag_of_Nunavut.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/6/69/Flag_of_Yukon.svg/23px-Flag_of_Yukon.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Flag_of_South_Bohemian_Region.svg/23px-Flag_of_South_Bohemian_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Flag_of_South_Moravian_Region.svg/23px-Flag_of_South_Moravian_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/0/0b/Flag_of_Karlovy_Vary_Region.svg/23px-Flag_of_Karlovy_Vary_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Flag_of_Hradec_Kralove_Region.svg/23px-Flag_of_Hradec_Kralove_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/45/Flag_of_Liberec_Region.svg/23px-Flag_of_Liberec_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Flag_of_Moravian-Silesian_Region.svg/23px-Flag_of_Moravian-Silesian_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Flag_of_Olomouc_Region.svg/23px-Flag_of_Olomouc_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Flag_of_Pardubice_Region.svg/23px-Flag_of_Pardubice_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/4b/Flag_of_Plzen_Region.svg/23px-Flag_of_Plzen_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Flag_of_Prague.svg/23px-Flag_of_Prague.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Flag_of_Central_Bohemian_Region.svg/23px-Flag_of_Central_Bohemian_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/1/13/Flag_of_Usti_nad_Labem_Region.svg/23px-Flag_of_Usti_nad_Labem_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/1/14/Flag_of_Vysocina_Region.svg/23px-Flag_of_Vysocina_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Flag_of_Zlin_Region.svg/23px-Flag_of_Zlin_Region.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Flag_of_New_South_Wales.svg/23px-Flag_of_New_South_Wales.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/0/04/Flag_of_Queensland.svg/23px-Flag_of_Queensland.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Flag_of_South_Australia.svg/23px-Flag_of_South_Australia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Flag_of_Tasmania.svg/23px-Flag_of_Tasmania.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/0/08/Flag_of_Victoria_%28Australia%29.svg/23px-Flag_of_Victoria_%28Australia%29.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Flag_of_Western_Australia.svg/23px-Flag_of_Western_Australia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/8c/Flag_of_the_Australian_Capital_Territory.svg/23px-Flag_of_the_Australian_Capital_Territory.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/Flag_of_the_Northern_Territory.svg/23px-Flag_of_the_Northern_Territory.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Flag_of_Alsace.svg/23px-Flag_of_Alsace.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Flag_of_Aquitaine.svg/23px-Flag_of_Aquitaine.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/Flag_of_Auvergne.svg/23px-Flag_of_Auvergne.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/1/10/Flag_of_Basse-Normandie.svg/23px-Flag_of_Basse-Normandie.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3c/Flag_of_Bourgogne.svg/23px-Flag_of_Bourgogne.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Flag_of_Brittany.svg/23px-Flag_of_Brittany.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Flag_of_Centre_%28France%29.svg/23px-Flag_of_Centre_%28France%29.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Champagne-Ardenne_flag.svg/23px-Champagne-Ardenne_flag.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Flag_of_Corsica.svg/23px-Flag_of_Corsica.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/7/7e/Franche-Comt%C3%A9.svg/23px-Franche-Comt%C3%A9.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/bf/Haute-Normandie_flag.svg/23px-Haute-Normandie_flag.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/7/78/Flag_of_%C3%8Ele-de-France.svg/23px-Flag_of_%C3%8Ele-de-France.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/Flag_of_Languedoc-Roussillon.svg/23px-Flag_of_Languedoc-Roussillon.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Flag_of_Limousin.svg/23px-Flag_of_Limousin.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Flag_of_Lorraine.svg/23px-Flag_of_Lorraine.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Flag_of_Midi-Pyr%C3%A9n%C3%A9es.svg/23px-Flag_of_Midi-Pyr%C3%A9n%C3%A9es.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Flag_of_Flemish_Region_%28De_Vlaamse_Leeuw%29.svg/23px-Flag_of_Flemish_Region_%28De_Vlaamse_Leeuw%29.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Flag_of_Pays-de-la-Loire.svg/23px-Flag_of_Pays-de-la-Loire.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Flag_of_Picardie.svg/23px-Flag_of_Picardie.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/3/39/Poitou-Charentes_flag.svg/23px-Poitou-Charentes_flag.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Flag_of_Provence-Alpes-Cote_dAzur.svg/23px-Flag_of_Provence-Alpes-Cote_dAzur.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Flag_of_Rh%C3%B4ne-Alpes.svg/23px-Flag_of_Rh%C3%B4ne-Alpes.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/45/Flag_of_Abruzzo.svg/23px-Flag_of_Abruzzo.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/8e/Flag_of_Basilicata.svg/23px-Flag_of_Basilicata.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Flag_of_Calabria.svg/23px-Flag_of_Calabria.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Flag_of_Campania.svg/23px-Flag_of_Campania.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Flag_of_Emilia-Romagna.svg/23px-Flag_of_Emilia-Romagna.svg.png",
"http://upload.wikimedia.org/wikipedia/en/thumb/b/b0/Flag_of_Friuli-Venezeia_Giulia.png/23px-Flag_of_Friuli-Venezeia_Giulia.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/Flag_of_Lazio.svg/23px-Flag_of_Lazio.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/88/Flag_of_Liguria.svg/23px-Flag_of_Liguria.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Flag_of_Lombardy.svg/23px-Flag_of_Lombardy.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/0/07/Flag_of_Marche.svg/23px-Flag_of_Marche.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Flag_of_Molise.svg/23px-Flag_of_Molise.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/Flag_of_Piedmont.svg/23px-Flag_of_Piedmont.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/Flag_of_Apulia.png/23px-Flag_of_Apulia.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/6/65/Flag_of_Sardinia.svg/23px-Flag_of_Sardinia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Flag_of_Sicily_%28revised%29.svg/23px-Flag_of_Sicily_%28revised%29.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/f2/Flag_of_Tuscany.svg/23px-Flag_of_Tuscany.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Flag_of_Trentino-South_Tyrol.svg/23px-Flag_of_Trentino-South_Tyrol.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/cc/Flag_of_Umbria.svg/23px-Flag_of_Umbria.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/Flag_of_Valle_d%27Aosta.svg/23px-Flag_of_Valle_d%27Aosta.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Flag_of_Veneto.svg/23px-Flag_of_Veneto.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Flag_of_Andaluc%C3%ADa.svg/23px-Flag_of_Andaluc%C3%ADa.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/1/18/Flag_of_Aragon.svg/23px-Flag_of_Aragon.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Flag_of_Asturias.svg/23px-Flag_of_Asturias.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Flag_of_the_Canary_Islands.svg/23px-Flag_of_the_Canary_Islands.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/3/30/Flag_of_Cantabria.svg/23px-Flag_of_Cantabria.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Bandera_Castilla-La_Mancha.svg/23px-Bandera_Castilla-La_Mancha.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/1/13/Flag_of_Castile_and_Le%C3%B3n.svg/20px-Flag_of_Castile_and_Le%C3%B3n.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Flag_of_Catalonia.svg/23px-Flag_of_Catalonia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Flag_of_Extremadura_with_COA.svg/23px-Flag_of_Extremadura_with_COA.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/6/64/Flag_of_Galicia.svg/23px-Flag_of_Galicia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/7/7b/Flag_of_the_Balearic_Islands.svg/23px-Flag_of_the_Balearic_Islands.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/db/Flag_of_La_Rioja_%28with_coat_of_arms%29.svg/23px-Flag_of_La_Rioja_%28with_coat_of_arms%29.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/9/9c/Flag_of_the_Community_of_Madrid.svg/23px-Flag_of_the_Community_of_Madrid.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Flag_of_the_Region_of_Murcia.svg/23px-Flag_of_the_Region_of_Murcia.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Bandera_de_Navarra.svg/23px-Bandera_de_Navarra.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Flag_of_the_Basque_Country.svg/23px-Flag_of_the_Basque_Country.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/1/16/Flag_of_the_Valencian_Community_%282x3%29.svg/23px-Flag_of_the_Valencian_Community_%282x3%29.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Flag_Ceuta.svg/23px-Flag_Ceuta.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Flag_of_Melilla.svg/23px-Flag_of_Melilla.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/ff/Banskobystricky_vlajka.svg/23px-Banskobystricky_vlajka.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Bratislavsky_vlajka.svg/23px-Bratislavsky_vlajka.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Kosicky_vlajka.svg/23px-Kosicky_vlajka.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Nitriansky_vlajka.svg/23px-Nitriansky_vlajka.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Presovsky_vlajka.svg/23px-Presovsky_vlajka.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Trenciansky_vlajka.svg/23px-Trenciansky_vlajka.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Trnavsky_vlajka.svg/23px-Trnavsky_vlajka.svg.png",
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/d8/Zilinsky_vlajka.svg/23px-Zilinsky_vlajka.svg.png",
]
def main():
for url, code in zip(urls, codes):
print url, code
filename = 'flags/' + code.lower() + '.png'
urllib.urlretrieve(url, filename)
if __name__ == '__main__':
main()