From ec36df48514a6c7b88708ab22dd80c8ae66febde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 30 Jan 2020 17:55:12 +0100 Subject: [PATCH] [deviantart] fix video extraction from 'extended_fetch' results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DeviantArt is now serving videos from wixmp servers (1), instead of the former film00.deviantart.com (2), even though those URLS are still functional. They seem to also have re-encoded those videos. The 10 MB 1080p video from (2) is now only available in 720p at ~20 MB (with a higher bitrate, but still …). Other videos are still available in 1080p, but not this one for some reason. (Changing the '720p' in (1) to '1080p' doesn't work.) (1) https://wixmp-ed30a86b8c4ca887773594c2.wixmp.com/v/mp4/9feaa2c9-1baf-4fc2-84f7-f3384b34cefe/d5gxnb5-282a2e9a-b552-40ff-8542-b3c5eed823f5.720p.a837d7cec12c41be8ca2ee53152cea3a.mp4 (2) https://film00.deviantart.net/4c1d/v/mp4/2012/279/d/1/_video____brushes_i_use_in_paint_tool_sai_by_chi_u-d5gxnb5.mp4 --- gallery_dl/extractor/deviantart.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index 15f10a1b..c754379f 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -717,7 +717,7 @@ class DeviantartExtractorV2(DeviantartExtractor): # select largest video target = max(media["types"], key=lambda x: text.parse_int(x.get("q", "")[:-1])) - src = target["s"] + src = target["b"] elif target["t"] == "flash": src = target["s"] @@ -811,15 +811,17 @@ class DeviantartDeviationExtractor(DeviantartExtractorV2): }), # video ("https://www.deviantart.com/chi-u/art/-VIDEO-Brushes-330774593", { - "url": "3b6e6e761d2d393fa61a4dc3ed6e7db51b14d07b", + "pattern": r"https://wixmp-.+wixmp.com/v/mp4/.+\.720p\.\w+.mp4", "keyword": { "filename": r"re:_video____brushes_\w+_by_chi_u-d5gxnb5", "extension": "mp4", "target": { "d": 306, - "f": 9963639, - "q": "1080p", + "f": 19367585, + "h": 720, + "q": "720p", "t": "video", + "w": 1364, "src": str, }, }