mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Fix tests
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
from pafy import backend_youtube_dl
|
||||||
import pafy
|
import pafy
|
||||||
|
|
||||||
from spotdl import internals
|
from spotdl import internals
|
||||||
@@ -26,7 +27,7 @@ def _process_streams(self):
|
|||||||
self._ydl_info['formats'][format_index]['url'] = self._ydl_info['formats'][format_index]['fragment_base_url']
|
self._ydl_info['formats'][format_index]['url'] = self._ydl_info['formats'][format_index]['fragment_base_url']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
return pafy.backend_youtube_dl.YtdlPafy._old_process_streams(self)
|
return backend_youtube_dl.YtdlPafy._old_process_streams(self)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _content_available(cls, url):
|
def _content_available(cls, url):
|
||||||
@@ -40,5 +41,5 @@ class PatchPafy:
|
|||||||
pafy.backend_shared.BasePafy.getbestthumb = _getbestthumb
|
pafy.backend_shared.BasePafy.getbestthumb = _getbestthumb
|
||||||
|
|
||||||
def patch_process_streams(self):
|
def patch_process_streams(self):
|
||||||
pafy.backend_youtube_dl.YtdlPafy._old_process_streams = pafy.backend_youtube_dl.YtdlPafy._process_streams
|
backend_youtube_dl.YtdlPafy._old_process_streams = backend_youtube_dl.YtdlPafy._process_streams
|
||||||
pafy.backend_youtube_dl.YtdlPafy._process_streams = _process_streams
|
backend_youtube_dl.YtdlPafy._process_streams = _process_streams
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import pafy
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
patcher.patch_pafy()
|
pafy_patcher = patcher.PatchPafy()
|
||||||
|
pafy_patcher.patch_getbestthumb()
|
||||||
|
|
||||||
class TestPafyContentAvailable:
|
class TestPafyContentAvailable:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user