diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 24b97c2..0a4245f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -61,6 +61,7 @@ jobs: python-version: '2.7' - name: Patch third-party deps + if: false # disabled shell: bash working-directory: PlexyGlass.bundle/third-party run: | diff --git a/Dockerfile b/Dockerfile index 16c376e..b5087dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,14 +48,14 @@ python2 -m pip --no-python-version-warning --disable-pip-version-check install - python2 ./scripts/build_plist.py _BUILD -# patch youtube-dl, cannot use git apply because we don't pass in any git files -WORKDIR /build/Contents/Libraries/Shared -RUN <<_PATCH -#!/bin/bash -set -e -patch_dir=/build/patches -patch -p1 < "${patch_dir}/youtube_dl-compat.patch" -_PATCH +## patch youtube-dl, cannot use git apply because we don't pass in any git files +#WORKDIR /build/Contents/Libraries/Shared +#RUN <<_PATCH +##!/bin/bash +#set -e +#patch_dir=/build/patches +#patch -p1 < "${patch_dir}/youtube_dl-compat.patch" +#_PATCH WORKDIR /build diff --git a/docs/source/contributing/build.rst b/docs/source/contributing/build.rst index e634453..28d7451 100644 --- a/docs/source/contributing/build.rst +++ b/docs/source/contributing/build.rst @@ -18,14 +18,14 @@ Setup venv ---------- It is recommended to setup and activate a `venv`_. -Apply Patches -------------- -Patch YouTube-DL - .. code-block:: bash - - pushd ./third-party/youtube-dl - git apply -v ../../patches/youtube_dl-compat.patch - popd +.. Apply Patches +.. ------------- +.. Patch YouTube-DL +.. .. code-block:: bash +.. +.. pushd ./third-party/youtube-dl +.. git apply -v ../../patches/youtube_dl-compat.patch +.. popd Install Requirements -------------------- diff --git a/patches/youtube_dl-compat.patch b/patches/youtube_dl-compat.patch deleted file mode 100644 index 9c87839..0000000 --- a/patches/youtube_dl-compat.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py -index 3c526a78d..6e2a92d92 100644 ---- a/youtube_dl/compat.py -+++ b/youtube_dl/compat.py -@@ -58,18 +58,22 @@ except ImportError: # Python 2 - - # Also fix up lack of method arg in old Pythons - try: -- _req = compat_urllib_request.Request -- _req('http://127.0.0.1', method='GET') -+ type(compat_urllib_request.Request('http://127.0.0.1', method='GET')) - except TypeError: -- class _request(object): -- def __new__(cls, url, *args, **kwargs): -- method = kwargs.pop('method', None) -- r = _req(url, *args, **kwargs) -- if method: -- r.get_method = types.MethodType(lambda _: method, r) -- return r -- -- compat_urllib_request.Request = _request -+ def _add_init_method_arg(cls): -+ init = cls.__init__ -+ -+ def wrapped_init(self, *args, **kwargs): -+ method = kwargs.pop('method', 'GET') -+ init(self, *args, **kwargs) -+ if self.has_data() and method == 'GET': -+ method = 'POST' -+ self.get_method = types.MethodType(lambda _: method, self) -+ -+ cls.__init__ = wrapped_init -+ -+ _add_init_method_arg(compat_urllib_request.Request) -+ del _add_init_method_arg - - - try: diff --git a/third-party/youtube-dl b/third-party/youtube-dl index be008e6..820fae3 160000 --- a/third-party/youtube-dl +++ b/third-party/youtube-dl @@ -1 +1 @@ -Subproject commit be008e657d79832642e2158557c899249c9e31cd +Subproject commit 820fae3b3a8587a6f57afbe803b4f91de7d4e086