Mercurial > codedump
comparison getlist.py @ 41:37f231f85a67
add tabs to some c++ files and fix win95kg.cpp
| author | Paper <mrpapersonic@gmail.com> | 
|---|---|
| date | Wed, 30 Jun 2021 02:38:59 -0400 | 
| parents | 2aa9614cb39a | 
| children | eac6dae753ca | 
   comparison
  equal
  deleted
  inserted
  replaced
| 40:2aa9614cb39a | 41:37f231f85a67 | 
|---|---|
| 41 f = open("list.txt", "w", encoding="utf-8") | 41 f = open("list.txt", "w", encoding="utf-8") | 
| 42 f.write("") | 42 f.write("") | 
| 43 f.close() | 43 f.close() | 
| 44 count = 1 | 44 count = 1 | 
| 45 for i in range(amount): # this may count as spamming the api but i don't care lol | 45 for i in range(amount): # this may count as spamming the api but i don't care lol | 
| 46 with urllib.request.urlopen( | 46 with urllib.request.urlopen(f'https://api.themoviedb.org/3/tv/{str(id)}/season/{season}/episode/{count}?api_key={key}') as url: | 
| 47 f'https://api.themoviedb.org/3/tv/{str(id)}/season/{season}/episode/{count}?api_key={key}') as url: | |
| 48 data = json.loads(url.read().decode()) | 47 data = json.loads(url.read().decode()) | 
| 49 f = open("list.txt", "a", encoding="utf-8") | 48 f = open("list.txt", "a", encoding="utf-8") | 
| 50 f.write(data["name"].replace("?", "?").replace( | 49 f.write(data["name"].replace("?", "?").replace( | 
| 51 ":", "꞉").replace('"', "“").split("/")[0].rstrip() + "\n") | 50 ":", "꞉").replace('"', "“").split("/")[0].rstrip() + "\n") | 
| 52 count += 1 | 51 count += 1 | 
