Commit 69440add authored by Alessandro Melchiorre's avatar Alessandro Melchiorre
Browse files

Using requets instead of faster_than_requests

parent c30f085c
......@@ -4,7 +4,7 @@ import os
import time
import urllib.parse
import faster_than_requests as requests
import requests
from tqdm import tqdm
......@@ -36,11 +36,10 @@ class LastFMCrawler:
rs = requests.get(url)
self.last_call = time.time()
status = rs["status"]
if status != "200 OK":
raise Exception(status)
if not rs:
raise Exception(rs.status_code)
content = json.loads(rs["body"])
content = rs.json()
# Crash test
_ = content['recenttracks']
break
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment