From 0f4d89505836525b813023f528386c2e87a7aa20 Mon Sep 17 00:00:00 2001 From: Eric Date: Sat, 16 Sep 2017 18:10:24 +0800 Subject: [PATCH] fantasy.tv video will not abled to download successfully. plz delete this file --- src/you_get/extractors/fantasy.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/you_get/extractors/fantasy.py b/src/you_get/extractors/fantasy.py index 3c7bee25..55999f9e 100644 --- a/src/you_get/extractors/fantasy.py +++ b/src/you_get/extractors/fantasy.py @@ -22,7 +22,13 @@ def fantasy_download_by_id_channelId(id = 0, channelId = 0, output_dir = '.', me raise Exception('API error!') title = html['data']['tv']['title'] - +``` +this website put the video source in the ali cdn and used the ali-prismplayer.js https://player.alicdn.com/prismplayer/index.html +first send a get request of https://171-113-204-241-159305376.dns-detect.alicdn.com/api/cdnDetectHttps?method=commitDetectHttps&detectId=159305376&callback=jsonp_callback_6174&cb=jsonp_callback_6174 +to verify the referer host whether is allowed or not +if the referer is empty or not in the whitelist the video will not allow to download +ALL IN ALL : the prismplayer.js will verfiy the request referer. if the referer is allowed the the video will send +``` video_url = html['data']['tv']['videoPath'] headers = fake_headers.copy() headers['Referer'] = api_url