From 9c55f9395519f45c5768169fb7db9f4b79150b06 Mon Sep 17 00:00:00 2001 From: MaxwellGoblin Date: Fri, 8 Sep 2017 21:05:16 +0800 Subject: [PATCH] [fantasy]request with referer --- src/you_get/extractors/fantasy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/you_get/extractors/fantasy.py b/src/you_get/extractors/fantasy.py index d072af06..3c7bee25 100644 --- a/src/you_get/extractors/fantasy.py +++ b/src/you_get/extractors/fantasy.py @@ -24,11 +24,13 @@ def fantasy_download_by_id_channelId(id = 0, channelId = 0, output_dir = '.', me title = html['data']['tv']['title'] video_url = html['data']['tv']['videoPath'] - type, ext, size = url_info(video_url) + headers = fake_headers.copy() + headers['Referer'] = api_url + type, ext, size = url_info(video_url, headers=headers) print_info(site_info, title, type, size) if not info_only: - download_urls([video_url], title, ext, size, output_dir, merge = merge, headers = fake_headers) + download_urls([video_url], title, ext, size, output_dir, merge = merge, headers = headers) def fantasy_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):