Skip to content

Instantly share code, notes, and snippets.

@vgmoose
Last active September 24, 2018 02:06
Show Gist options
  • Save vgmoose/75d9b53d73deb8cc7587549a2379a01f to your computer and use it in GitHub Desktop.
Save vgmoose/75d9b53d73deb8cc7587549a2379a01f to your computer and use it in GitHub Desktop.
wget https://pastebin.com/raw/vs5UfDF3; cat vs5UfDF3 | python3 count.py
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