Browse Source

Merge pull request #10 from Data-Horde/halt-discovery

UPDATE YOUR WORKERS FOLKS!
master
madprogramer 3 years ago
committed by GitHub
parent
commit
f8705a8524
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions
  1. +14
    -1
      worker.py

+ 14
- 1
worker.py View File

@@ -100,6 +100,8 @@ class GracefulKiller:


gkiller = GracefulKiller() gkiller = GracefulKiller()


#REMOVED PANIC MECHANISM!
"""
enres = getmetadata(mysession, "IjJKfe-0Ty0", True)[0] enres = getmetadata(mysession, "IjJKfe-0Ty0", True)[0]
if not enres: if not enres:
print("Community Contribution discovery has been disabled for this account, please report this on our Discord as this may have caused some videos to be incorrectly marked as having community contributions disabled.") print("Community Contribution discovery has been disabled for this account, please report this on our Discord as this may have caused some videos to be incorrectly marked as having community contributions disabled.")
@@ -107,6 +109,7 @@ if not enres:
gkiller.kill_now = True #exit the script gkiller.kill_now = True #exit the script


del enres del enres
"""


#microtasks #microtasks
def threadrunner(): def threadrunner():
@@ -118,8 +121,11 @@ def threadrunner():
if not jobs.empty(): if not jobs.empty():
task, vid, args = jobs.get() task, vid, args = jobs.get()
if task == "submitdiscovery": if task == "submitdiscovery":
tracker.add_item_to_tracker(args, vid)
#tracker.add_item_to_tracker(args, vid)
#jobs.put(("complete", None, "video:"+vid))
pass
elif task == "discovery": elif task == "discovery":
"""
while True: while True:
try: try:
info = getmetadata(mysession, str(vid).strip()) info = getmetadata(mysession, str(vid).strip())
@@ -154,6 +160,9 @@ def threadrunner():
jobs.put(("submitdiscovery", mixdisc, tracker.ItemType.MixPlaylist)) jobs.put(("submitdiscovery", mixdisc, tracker.ItemType.MixPlaylist))
for playldisc in info[5]: for playldisc in info[5]:
jobs.put(("submitdiscovery", playldisc, tracker.ItemType.Playlist)) jobs.put(("submitdiscovery", playldisc, tracker.ItemType.Playlist))
"""
jobs.put(("complete", None, "video:"+vid))
pass


elif task == "subtitles": elif task == "subtitles":
subprrun(mysession, args, vid, "default", needforcemetadata, needforcecaptions) subprrun(mysession, args, vid, "default", needforcemetadata, needforcecaptions)
@@ -227,6 +236,8 @@ def threadrunner():
# get a new task from tracker # get a new task from tracker
collect() #cleanup collect() #cleanup


#Protection Mechanism Disarmed
"""
#check that the account has community contributions enabled every 50th item #check that the account has community contributions enabled every 50th item
validationtimes += 1 validationtimes += 1
if not validationtimes % 50: if not validationtimes % 50:
@@ -236,6 +247,7 @@ def threadrunner():
shouldgetjob = False shouldgetjob = False
gkiller.kill_now = True #exit the script gkiller.kill_now = True #exit the script
del enres del enres
"""


if shouldgetjob: if shouldgetjob:
desit = tracker.request_item_from_tracker() desit = tracker.request_item_from_tracker()
@@ -299,6 +311,7 @@ for x in threads:
del x del x


if not shouldgetjob: if not shouldgetjob:
print("PROTECTION MECHANISM #3 WAS SOMEHOW TRIGERRED")
print("Community Contribution discovery has been disabled for this account, please report this on our Discord as this may have caused some videos to be incorrectly marked as having community contributions disabled.") print("Community Contribution discovery has been disabled for this account, please report this on our Discord as this may have caused some videos to be incorrectly marked as having community contributions disabled.")


print("Exiting...") print("Exiting...")

Loading…
Cancel
Save