mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 11:24:02 +03:00
[panda]quit if cannot found room id from url
This commit is contained in:
parent
35905c2bac
commit
38e3b4618f
@ -3,11 +3,15 @@
|
|||||||
__all__ = ['panda_download']
|
__all__ = ['panda_download']
|
||||||
|
|
||||||
from ..common import *
|
from ..common import *
|
||||||
|
from ..util.log import *
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
|
|
||||||
def panda_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):
|
def panda_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):
|
||||||
roomid = url[url.rfind('/')+1:]
|
roomid = re.search('/(\d+)', url)
|
||||||
|
if roomid is None:
|
||||||
|
log.wtf('Cannot found room id for this url')
|
||||||
|
roomid = roomid.group(1)
|
||||||
json_request_url ="http://www.panda.tv/api_room_v2?roomid={}&__plat=pc_web&_={}".format(roomid, int(time.time()))
|
json_request_url ="http://www.panda.tv/api_room_v2?roomid={}&__plat=pc_web&_={}".format(roomid, int(time.time()))
|
||||||
content = get_html(json_request_url)
|
content = get_html(json_request_url)
|
||||||
api_json = json.loads(content)
|
api_json = json.loads(content)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user