diff --git a/gallery_dl/extractor/directlink.py b/gallery_dl/extractor/directlink.py index 1368a625..4870cd73 100644 --- a/gallery_dl/extractor/directlink.py +++ b/gallery_dl/extractor/directlink.py @@ -17,11 +17,11 @@ class DirectlinkExtractor(Extractor): category = "directlink" directory_fmt = [] filename_fmt = "{filename}" - pattern = [r"https?://[^?&#]+\.(?:jpe?g|png|gifv?|webm|mp4)"] - test = [("https://i.imgur.com/21yMxCS.png", { - "url": "6f2dcfb86815bdd72808c313e5f715610bc7b9b2", - "keyword": "6a9636d8dd6f71f14d6d20d24153fc83a9895ed9", - "content": "0c8768055e4e20e7c7259608b67799171b691140", + pattern = [r"https?://[^?&#]+\.(?:jpe?g|png|gif|webm|mp4|ogg)"] + test = [(("https://photos.smugmug.com/The-World/Hawaii/" + "i-SWz2K6n/2/X3/IMG_0311-X3.jpg"), { + "url": "32ee1045881e17ef3f13a9958595afa42421ec6c", + "keyword": "5bd7871a6957e1693c43abf31d7c0a38e39a81de", })] def __init__(self, match): diff --git a/gallery_dl/extractor/mangapark.py b/gallery_dl/extractor/mangapark.py index c418bcf4..9dc91e8a 100644 --- a/gallery_dl/extractor/mangapark.py +++ b/gallery_dl/extractor/mangapark.py @@ -39,8 +39,8 @@ class MangaparkChapterExtractor(Extractor): r"([^/]+/s(\d+)(?:/v([^/]+))?/c(\d+)(?:([^/]+)|/e(\d+))?)")] test = [ ("http://mangapark.me/manga/gosu/s2/c55", { - "url": "fefe84492d9118de5962563fbecb9362051c52d5", - "keyword": "652b38c40bdfb5592456b6e7524a3acfdef9fae6", + "url": "482d4a27c1e7f03cff8afac145d06f3ddeac82bb", + "keyword": "bd97ca24ef344b44292910384215ef3f1005ea2e", }), (("http://mangapark.me/manga/" "ad-astra-per-aspera-hata-kenjirou/s1/c1.2"), { diff --git a/gallery_dl/extractor/yonkouprod.py b/gallery_dl/extractor/yonkouprod.py index 56dcaa10..3ae4fef3 100644 --- a/gallery_dl/extractor/yonkouprod.py +++ b/gallery_dl/extractor/yonkouprod.py @@ -25,6 +25,6 @@ class YonkouprodMangaExtractor(foolslide.FoolslideMangaExtractor): """Extractor for manga from yonkouprod.com""" category = "yonkouprod" pattern = foolslide.manga_pattern(r"(?:www\.)?yonkouprod\.com/reader") - test = [("https://yonkouprod.com/reader/series/one-punch-man/", { - "url": "e17ed7a2098e2f18e50b64a28a810f62687d05e2", + test = [("https://yonkouprod.com/reader/series/attack-on-titan/", { + "url": "9d43602ad4a3a8cf65922bf106affa5a6b9523b1", })] diff --git a/scripts/create_test_data.py b/scripts/create_test_data.py index 452b1056..aeee611d 100755 --- a/scripts/create_test_data.py +++ b/scripts/create_test_data.py @@ -20,6 +20,12 @@ TESTDATA_FMT = """ }})] """ +TESTDATA_EXCEPTION_FMT = """ + test = [("{}", {{ + "exception": "{}", + }})] +""" + def main(): parser = argparse.ArgumentParser() parser.add_argument("--content", action="store_true") @@ -39,10 +45,18 @@ def main(): config.load() for url in urls: tjob = job.TestJob(url, content=args.content) - tjob.run() + try: + tjob.run() + except Exception as exc: + fmt = TESTDATA_EXCEPTION_FMT + data = (exc.__class__.__name__,) + else: + fmt = TESTDATA_FMT + data = (tjob.hash_url.hexdigest(), + tjob.hash_keyword.hexdigest(), + tjob.hash_content.hexdigest()) print(tjob.extractor.__class__.__name__) - print(TESTDATA_FMT.format(url, tjob.hash_url.hexdigest(), - tjob.hash_keyword.hexdigest(), tjob.hash_content.hexdigest())) + print(fmt.format(url, *data)) if __name__ == '__main__': main()