├── .gitattributes ├── README.md └── subs.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | howCode's Python script for counting YouTube subscribers. 2 | ======================================================== 3 | 4 | You can use this code for anything you'd like, no credit etc ... required. It would be nice though! 5 | 6 | You can watch the video here: https://www.youtube.com/watch?v=jaxjVqgLEs0 7 | 8 | Enjoy! 9 | -------------------------------------------------------------------------------- /subs.py: -------------------------------------------------------------------------------- 1 | import urllib.request 2 | import json 3 | 4 | name=input("Enter username: ") 5 | key = "YOUR KEY GOES HERE" 6 | 7 | data = urllib.request.urlopen("https://www.googleapis.com/youtube/v3/channels?part=statistics&forUsername="+name+"&key="+key).read() 8 | subs = json.loads(data)["items"][0]["statistics"]["subscriberCount"] 9 | 10 | print(name + " has " + "{:,d}".format(int(subs)) + " subscribers!🎉") 11 | --------------------------------------------------------------------------------