Skip to content

Commit

Permalink
Add docs on what this is about
Browse files Browse the repository at this point in the history
  • Loading branch information
ritiek committed Jun 3, 2019
1 parent fd74adb commit 9f1f361
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spotdl/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,21 @@ def _content_available(cls, url):


class PatchPafy:
"""
These patches have not been released by pafy on PyPI yet but
are useful to us.
"""
def patch_getbestthumb(self):
# https://github.com/mps-youtube/pafy/pull/211
pafy.backend_shared.BasePafy._bestthumb = None
pafy.backend_shared.BasePafy._content_available = _content_available
pafy.backend_shared.BasePafy.getbestthumb = _getbestthumb

def patch_process_streams(self):
# https://github.com/mps-youtube/pafy/pull/230
backend_youtube_dl.YtdlPafy._old_process_streams = backend_youtube_dl.YtdlPafy._process_streams
backend_youtube_dl.YtdlPafy._process_streams = _process_streams

def patch_insecure_streams(self):
# https://github.com/mps-youtube/pafy/pull/235
pafy.g.def_ydl_opts["prefer_insecure"] = False

0 comments on commit 9f1f361

Please sign in to comment.