Last active
September 24, 2018 02:06
-
-
Save vgmoose/75d9b53d73deb8cc7587549a2379a01f to your computer and use it in GitHub Desktop.
wget https://pastebin.com/raw/vs5UfDF3; cat vs5UfDF3 | python3 count.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.request import urlopen | |
from urllib.parse import urlencode | |
import json | |
print("Enter list of titles separted by a new line (or pipe into this program)") | |
while True: | |
try: | |
TITLE = input().rstrip() | |
except: | |
break | |
response = urlopen("https://www.srrdb.com/api/details/%s" % TITLE) | |
contents = response.read().decode("utf-8") | |
if contents: | |
info = json.loads(contents)["archived-files"] | |
if info and len(info) > 0: | |
print("%s\t%s\t%s\t%s" % (TITLE, info[0]["name"], info[0]["size"], info[0]["crc"])) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment