griimnak
You're a slave to the money then you die
ytwatchdog-py
This is a simple watchdog script that watches youtube subscription count by scraping channel html with
This is a simple watchdog script that watches youtube subscription count by scraping channel html with
You must be registered for see links
.Source:
You must be registered for see links
Usage:
python ytwatchdog.py https://youtube.com/user/PewDiePie
Config:
Python:
"""
Seconds to minutes cheat sheet
120 -> 2m
600 -> 10m
3600 -> 1hr
43200 -> 12hr
86400 -> 24hr
"""
URL = sys.argv[1] if len(sys.argv) > 1 else "https://youtube.com/user/PewDiePie" # URL = ""
watch_subs = True # or False
sleep_time = 600 # seconds
You can easily add your own events to the function below
Python:
def compare_sub_count():
""" Compares sub count of subs and subs_new
"""
subs = int(data["sub_count"].replace(",", "")) # current data
scrape(URL) # renew data
subs_new = int(data["sub_count"].replace(",", "")) # renewed sub count
# Subs lost
if(subs > subs_new):
print(data["channel_name"] + " lost", subs - subs_new, "subscribers :(")
print(subs_new, "-", subs,)
# Subs gained
if(subs < subs_new):
print(data["channel_name"] + " gained", subs_new - subs, "subscribers :D")
# No change
if(subs == subs_new):
print("No change in subscription count.")
print(data["sub_count"])
print("\n[" + time.ctime() +"] Subscriber watchdog renewing..")
Last edited: