2 Commitit

Tekijä SHA1 Viesti Päivämäärä
  tech234a ede8c81927 Add shutdown notification and username sending 3 vuotta sitten
  tech234a 0210fe93dc
Add notice about project completion 3 vuotta sitten
2 muutettua tiedostoa jossa 29 lisäystä ja 0 poistoa
  1. +2
    -0
      README.md
  2. +27
    -0
      worker.py

+ 2
- 0
README.md Näytä tiedosto

@@ -1,6 +1,8 @@
# YouTube Community Contributions Archiving Worker # YouTube Community Contributions Archiving Worker
<a href="https://discord.gg/7QxcBvw"><img alt="Discord" src="https://img.shields.io/discord/755014354734153818?style=plastic"></a> <a href="https://discord.gg/7QxcBvw"><img alt="Discord" src="https://img.shields.io/discord/755014354734153818?style=plastic"></a>
## This project is now complete, and we are working on sorting and finalizing the data. Thank you to everyone who contributed!
Worker for the `Save Community Captions` project: Archiving unpublished YouTube community-contributions. Worker for the `Save Community Captions` project: Archiving unpublished YouTube community-contributions.


+ 27
- 0
worker.py Näytä tiedosto

@@ -1,3 +1,30 @@
# Let's remind people who still have this running to shut it down
from os.path import isfile
from json import loads
from os import environ
import requests
from sys import exit
if "TRACKER_USERNAME" in environ.keys():
TRACKER_USERNAME = environ["TRACKER_USERNAME"]
elif isfile("config.json"):
try:
TRACKER_USERNAME = loads(open("config.json").read())["TRACKER_USERNAME"]
except:
TRACKER_USERNAME = "Unnamed"
else:
TRACKER_USERNAME = "Unnamed"

print("=============================")
print("This project is now complete, and we are working on sorting and finalizing the data. Thank you to everyone who contributed!")
print("=============================")

print()

print("Just a heads up, we will send your TRACKER_USERNAME to the script admins just so we can remind you to shut down your worker if you've forgotten.")
requests.post("https://discord.com/api/webhooks/771212810877141032/dj9WCWZ2oE5t_vzdyc_OEdTaGbAP92bJFe8CEfYXlRXKJfPewOHWYAgBrLwx596k0CJC", json={"content": str(TRACKER_USERNAME)+" just tried to start a worker."})

exit(0)

from threading import Thread from threading import Thread
import requests import requests
from time import sleep from time import sleep


Ladataan…
Peruuta
Tallenna