Browse Source

ccenabled check #1

master
madprogramer 3 years ago
parent
commit
4bd48e4de2
2 changed files with 16 additions and 2 deletions
  1. +15
    -1
      discovery.py
  2. +1
    -1
      tracker.py

+ 15
- 1
discovery.py View File

@@ -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():


+ 1
- 1
tracker.py View File

@@ -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"


Loading…
Cancel
Save