Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alessandro Melchiorre
last_fm_crawler
Commits
69440add
Commit
69440add
authored
Aug 24, 2020
by
Alessandro Melchiorre
Browse files
Using requets instead of faster_than_requests
parent
c30f085c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/LastFMCrawler.py
View file @
69440add
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment