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 ...@@ -4,7 +4,7 @@ import os
import time import time
import urllib.parse import urllib.parse
import faster_than_requests as requests import requests
from tqdm import tqdm from tqdm import tqdm
...@@ -36,11 +36,10 @@ class LastFMCrawler: ...@@ -36,11 +36,10 @@ class LastFMCrawler:
rs = requests.get(url) rs = requests.get(url)
self.last_call = time.time() self.last_call = time.time()
status = rs["status"] if not rs:
if status != "200 OK": raise Exception(rs.status_code)
raise Exception(status)
content = json.loads(rs["body"]) content = rs.json()
# Crash test # Crash test
_ = content['recenttracks'] _ = content['recenttracks']
break break
......
Supports Markdown
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