fix of 'topic' url

This commit is contained in:
Justsoos 2017-01-26 15:46:47 +08:00
parent 23f9803482
commit 3fff227106

View File

@ -4,12 +4,14 @@ __all__ = ['zhanqi_download']
from ..common import * from ..common import *
import json import json
def zhanqi_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):#the programmers of zhanqi are noobs def zhanqi_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):#the programmers of zhanqi are noobs
host_name = url.split('/')[2] host_name = url.split('/')[2]
first_folder_path = url.split('/')[3] first_folder_path = url.split('/')[3]
if first_folder_path != 'videos': #url = "https://www.zhanqi.tv/huashan" if first_folder_path != 'videos': #url = "https://www.zhanqi.tv/huashan"
if first_folder_path == 'topic': #https://www.zhanqi.tv/topic/lyingman
first_folder_path = url.split('/')[4]
api_url = "https://www.zhanqi.tv/api/static/v2.1/room/domain/" + first_folder_path + ".json" api_url = "https://www.zhanqi.tv/api/static/v2.1/room/domain/" + first_folder_path + ".json"
api_json = json.loads(get_html(api_url)) api_json = json.loads(get_html(api_url))
data = api_json['data'] data = api_json['data']