Skip to content

Commit ef0dc8d

Browse files
committed
upgrade downloading
look trcustoms first even if there is trlevel redirection and get both if no download from trle.net
1 parent ca26cd5 commit ef0dc8d

File tree

2 files changed

+7
-165
lines changed

2 files changed

+7
-165
lines changed

database/sanitize_downloads.py

Lines changed: 0 additions & 159 deletions
This file was deleted.

database/scrape_trle_download.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
´x-´= we find another download for the same or reworked version elsewhere.
1717
Scraping should be able to follow but a small list with spacial cases could be accepted.
1818
19+
The special once that we need to handle separately
20+
War of the Worlds 3430 -> https://sites.google.com/view/trwotw/war-of-the-worlds/download
21+
There should be one more download that don't work but can remember which one
22+
1923
Fragments of the Core 1158 x- https://trcustoms.org/levels/1137
2024
Land of the Rising Sun 1186 -> trlevel.de x- https://trcustoms.org/levels/1165
2125
LB Advent Calendar 2004 - December 17th 1236 x- NO DOWNLOAD
@@ -109,7 +113,6 @@
109113
Louvre Galleries (Demo) 3362 -> https://trcustoms.org/levels/3295
110114
Kitten Adventure (Demo) 3379 -> https://trcustoms.org/levels/3312
111115
Create a Classic 2021 - Fantome 3426 -> https://trcustoms.org/levels/3359
112-
War of the Worlds 3430 -> https://sites.google.com/view/trwotw/war-of-the-worlds/download
113116
The Forbidden Place 3470 -> https://trcustoms.org/levels/3421
114117
Sanguis Virginis (Definitive Demo) 3491 x- https://trcustoms.org/levels/3438
115118
The Perils Ahead 3495 x- https://trcustoms.org/levels/3466
@@ -334,9 +337,11 @@ def get_zip_file_info(lid):
334337
redirect_url.startswith("https://www.trle.net/levels/levels/"):
335338
files = [_get_download_info(lid, redirect_url)]
336339

337-
if redirect_url.startswith("https://www.trle.net/sc/levelfeatures.php?lid="):
340+
if redirect_url.startswith("https://www.trle.net/sc/levelfeatures.php?lid=") or \
341+
redirect_url == "https://www.trlevel.de":
338342
trle_info = _get_trle_info(lid)
339343
files.extend(_search_trcustoms(trle_info))
344+
files.extend(_get_trlevel_download_info(trle_info))
340345

341346
if redirect_url.lower().endswith("/btb/web/index.html") and \
342347
redirect_url.startswith("https://www.trle.net/levels/levels"):
@@ -353,10 +358,6 @@ def get_zip_file_info(lid):
353358
trcustoms_level_dict = scrape_common.get_json(api_url)
354359
files = [_get_trcustoms_download_info(trcustoms_level_dict)]
355360

356-
if redirect_url == "https://www.trlevel.de":
357-
trle_info = _get_trle_info(lid)
358-
files.extend(_get_trlevel_download_info(trle_info))
359-
360361
return files
361362

362363

0 commit comments

Comments
 (0)