~nao20010128nao/ytdl-patched

c78e98743d33b0e3a7e18f4d79ff6410d127c679 — nao20010128nao a month ago cbc117d 1611276283
[viewsource] merge into generic extractor
3 files changed, 4 insertions(+), 16 deletions(-)

M youtube_dl/extractor/extractors.py
M youtube_dl/extractor/generic.py
D youtube_dl/extractor/viewsource.py
M youtube_dl/extractor/extractors.py => youtube_dl/extractor/extractors.py +0 -1
@@ 1453,7 1453,6 @@ from .viewlift import (
    ViewLiftIE,
    ViewLiftEmbedIE,
)
from .viewsource import ViewSourceIE
from .viidea import ViideaIE
from .vimeo import (
    VimeoIE,

M youtube_dl/extractor/generic.py => youtube_dl/extractor/generic.py +4 -0
@@ 2320,6 2320,10 @@ class GenericIE(InfoExtractor):
    def _real_extract(self, url):
        if url.startswith('//'):
            return self.url_result(self.http_scheme() + url)
        mobj = re.match(r'^view-source:(.+)$', url)
        if mobj:
            self._downloader.report_warning('URL is pasted with "view-source:" appended')
            return self.url_result(mobj.group(1))

        parsed_url = compat_urlparse.urlparse(url)
        if not parsed_url.scheme:

D youtube_dl/extractor/viewsource.py => youtube_dl/extractor/viewsource.py +0 -15
@@ 1,15 0,0 @@
# coding: utf-8
from __future__ import unicode_literals

from .common import InfoExtractor
import re


class ViewSourceIE(InfoExtractor):
    IE_DESC = False  # Do not list
    _VALID_URL = r'^view-source:'

    def _real_extract(self, url):
        self._downloader.report_warning('URL is pasted with "view-source:" appended')
        url = re.sub(self._VALID_URL, '', url)
        return self.url_result(url)