diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-07-23 23:53:04 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-07-23 23:57:45 -0700 |
commit | e00c3cf99f06e6f0c097e019219760cf26d16cbe (patch) | |
tree | 3d722ffaf11760d811e8d4f26106d045d0c63126 /youtube/playlist.py | |
parent | cb1c899a4570e8644dad572c7f00a3d96c844a2f (diff) | |
download | yt-local-e00c3cf99f06e6f0c097e019219760cf26d16cbe.tar.lz yt-local-e00c3cf99f06e6f0c097e019219760cf26d16cbe.tar.xz yt-local-e00c3cf99f06e6f0c097e019219760cf26d16cbe.zip |
Remove ad-hoc response saving from code, create a debug setting for fetch_url
Diffstat (limited to 'youtube/playlist.py')
-rw-r--r-- | youtube/playlist.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/youtube/playlist.py b/youtube/playlist.py index 18ddf49..5df7074 100644 --- a/youtube/playlist.py +++ b/youtube/playlist.py @@ -47,9 +47,7 @@ headers_1 = ( def playlist_first_page(playlist_id, report_text = "Retrieved playlist"): url = 'https://m.youtube.com/playlist?list=' + playlist_id + '&pbj=1' - content = util.fetch_url(url, util.mobile_ua + headers_1, report_text=report_text) - '''with open('debug/playlist_debug', 'wb') as f: - f.write(content)''' + content = util.fetch_url(url, util.mobile_ua + headers_1, report_text=report_text, debug_name='playlist_first_page') content = json.loads(util.uppercase_escape(content.decode('utf-8'))) return content @@ -67,9 +65,7 @@ def get_videos(playlist_id, page): 'X-YouTube-Client-Version': '2.20180508', } - content = util.fetch_url(url, headers, report_text="Retrieved playlist") - '''with open('debug/playlist_debug', 'wb') as f: - f.write(content)''' + content = util.fetch_url(url, headers, report_text="Retrieved playlist", debug_name='playlist_videos') info = json.loads(util.uppercase_escape(content.decode('utf-8'))) return info |