diff --git a/discovery.py b/discovery.py index 96b38b0..4ffaa21 100644 --- a/discovery.py +++ b/discovery.py @@ -29,7 +29,19 @@ def getmetadata(mysession, vid, ccenabledonly=False): recmixes = set() recplayl = set() - ccenabled = False #default values + pparams = ( + ("v", vid), + #("lang", langcode), + ("action_mde_edit_form", 1), + ("bl", "vmp"), + ("ui", "hd"), + ("tab", "captions"), + #('forceedit', 'captions'), + ("lang","en") + ) + mysession.headers.update({"cookie": "HSID="+cookies["HSID"]+"; SSID="+cookies["SSID"]+"; SID="+cookies["SID"], "Accept-Language": "en-US",}) + ccenabled = not "yet enabled community" in mysession.get("https://www.youtube.com/timedtext_editor", params=pparams).text + #print(mysession.get("https://www.youtube.com/timedtext_editor", params=pparams).text) creditdata = {} for line in wptext.splitlines(): @@ -63,10 +75,12 @@ def getmetadata(mysession, vid, ccenabledonly=False): recvids.add(elint["endpoint"]["watchEndpoint"]["videoId"]) recplayl.add(elint["endpoint"]["watchEndpint"]["playlistId"]) + """ if "captions" in initplay.keys(): ccenabled = "contribute" in initplay["captions"]["playerCaptionsRenderer"] else: ccenabled = False # if captions information is not present, community contributions are not enabled + """ if not ccenabledonly: if "videoDetails" in initplay.keys(): diff --git a/tracker.py b/tracker.py index 9273269..4f8cc7a 100644 --- a/tracker.py +++ b/tracker.py @@ -9,7 +9,7 @@ from os.path import isfile from json import loads # https://github.com/ArchiveTeam/tencent-weibo-grab/blob/9bae5f9747e014db9227821a9c11557267967023/pipeline.py -VERSION = "20200929.02" +VERSION = "20200930.01" TRACKER_ID = "ext-yt-communitycontribs" TRACKER_HOST = "trackerproxy.meo.ws"