mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-13 22:54:55 -04:00
Validate Deezer ARL when logging in
This commit is contained in:
parent
9c15293d44
commit
af50b7f9c7
1 changed files with 12 additions and 2 deletions
14
rip/cli.py
14
rip/cli.py
|
@ -276,13 +276,23 @@ class ConfigCommand(Command):
|
||||||
self.line("<info>Credentials saved to config.</info>")
|
self.line("<info>Credentials saved to config.</info>")
|
||||||
|
|
||||||
if self.option("deezer"):
|
if self.option("deezer"):
|
||||||
|
from streamrip.clients import DeezerClient
|
||||||
|
from streamrip.exceptions import AuthenticationError
|
||||||
|
|
||||||
self.line(
|
self.line(
|
||||||
"Follow the instructions at <url>https://github.com"
|
"Follow the instructions at <url>https://github.com"
|
||||||
"/nathom/streamrip/wiki/Finding-your-Deezer-ARL-Cookie</url>"
|
"/nathom/streamrip/wiki/Finding-your-Deezer-ARL-Cookie</url>"
|
||||||
)
|
)
|
||||||
|
|
||||||
config.file["deezer"]["arl"] = self.ask("Paste your ARL here: ")
|
given_arl = self.ask("Paste your ARL here: ").strip()
|
||||||
config.save()
|
self.line("<comment>Validating arl...</comment>")
|
||||||
|
try:
|
||||||
|
DeezerClient().login(arl=given_arl)
|
||||||
|
config.file["deezer"]["arl"] = given_arl
|
||||||
|
config.save()
|
||||||
|
self.line("<b>Sucessfully logged in!</b>")
|
||||||
|
except AuthenticationError:
|
||||||
|
self.line("<error>Could not log in. Double check your ARL</error>")
|
||||||
|
|
||||||
|
|
||||||
class ConvertCommand(Command):
|
class ConvertCommand(Command):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue