From eadf54e5319e5527b9cfee3c4302a42f1e744413 Mon Sep 17 00:00:00 2001 From: AbdullahM0hamed <25087116+AbdullahM0hamed@users.noreply.github.com> Date: Mon, 12 Oct 2020 18:51:29 +0100 Subject: [PATCH] Unencode urls for printing (#553) * Unencode urls for printing * get magnet links as provided by provider --- anime_downloader/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/anime_downloader/util.py b/anime_downloader/util.py index 3b20e11..5e2848a 100644 --- a/anime_downloader/util.py +++ b/anime_downloader/util.py @@ -18,7 +18,7 @@ import requests from tabulate import tabulate from uuid import uuid4 from secrets import choice -from urllib.parse import urlparse +from urllib.parse import urlparse, unquote from anime_downloader import session from anime_downloader.sites import get_anime_class, helpers @@ -207,7 +207,8 @@ def print_episodeurl(episode): # print(episode.source().stream_url + "?referer=" + episode.source().referer) # else: # Currently I don't know of a way to specify referer in url itself so leaving it here. - print(episode.source().stream_url) + url = episode.url if episode.url.startswith("magnet") else episode.source().stream_url + print(unquote(url)) def play_episode(episode, *, player, title):