The following issues were found

youtube_dl/extractor/linuxacademy.py
14 issues
Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              import random
import re

from .common import InfoExtractor
from ..compat import (
    compat_b64decode,
    compat_HTTPError,
    compat_str,
)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              import re

from .common import InfoExtractor
from ..compat import (
    compat_b64decode,
    compat_HTTPError,
    compat_str,
)
from ..utils import (

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

                  compat_HTTPError,
    compat_str,
)
from ..utils import (
    clean_html,
    ExtractorError,
    js_to_json,
    parse_duration,
    try_get,

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 126 Column: 17

                          if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
                error = self._parse_json(e.cause.read(), None)
                message = error.get('description') or error['code']
                raise ExtractorError(
                    '%s said: %s' % (self.IE_NAME, message), expected=True)
            raise

        callback_page, urlh = self._download_webpage_handle(
            'https://login.linuxacademy.com/login/callback', None,

            

Reported by Pylint.

Cell variable item defined in loop
Error

Line: 176 Column: 37

                                  continue

                def type_field(key):
                    return (try_get(item, lambda x: x['type'][key], compat_str) or '').lower()
                type_fields = (type_field('name'), type_field('slug'))
                # Move to next module section
                if 'section' in type_fields:
                    chapter = item.get('course_name')
                    chapter_id = item.get('course_module')

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import unicode_literals

import json
import random
import re

from .common import InfoExtractor
from ..compat import (
    compat_b64decode,

            

Reported by Pylint.

Missing class docstring
Error

Line: 25 Column: 1

              )


class LinuxAcademyIE(InfoExtractor):
    _VALID_URL = r'''(?x)
                    https?://
                        (?:www\.)?linuxacademy\.com/cp/
                        (?:
                            courses/lesson/course/(?P<chapter_id>\d+)/lesson/(?P<lesson_id>\d+)|

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 25 Column: 1

              )


class LinuxAcademyIE(InfoExtractor):
    _VALID_URL = r'''(?x)
                    https?://
                        (?:www\.)?linuxacademy\.com/cp/
                        (?:
                            courses/lesson/course/(?P<chapter_id>\d+)/lesson/(?P<lesson_id>\d+)|

            

Reported by Pylint.

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Security blacklist

Line: 79
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b311-random

              
        def random_string():
            return ''.join([
                random.choice('0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~')
                for _ in range(32)])

        webpage, urlh = self._download_webpage_handle(
            self._AUTHORIZE_URL, None, 'Downloading authorize page', query={
                'client_id': self._CLIENT_ID,

            

Reported by Bandit.

Variable name "e" doesn't conform to snake_case naming style
Error

Line: 122 Column: 9

                                  'Origin': 'https://login.linuxacademy.com',
                    'Referer': login_state_url,
                })
        except ExtractorError as e:
            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
                error = self._parse_json(e.cause.read(), None)
                message = error.get('description') or error['code']
                raise ExtractorError(
                    '%s said: %s' % (self.IE_NAME, message), expected=True)

            

Reported by Pylint.

youtube_dl/extractor/phoenix.py
14 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              
import re

from .youtube import YoutubeIE
from .zdf import ZDFBaseIE
from ..compat import compat_str
from ..utils import (
    int_or_none,
    merge_dicts,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              import re

from .youtube import YoutubeIE
from .zdf import ZDFBaseIE
from ..compat import compat_str
from ..utils import (
    int_or_none,
    merge_dicts,
    try_get,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              
from .youtube import YoutubeIE
from .zdf import ZDFBaseIE
from ..compat import compat_str
from ..utils import (
    int_or_none,
    merge_dicts,
    try_get,
    unified_timestamp,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              from .youtube import YoutubeIE
from .zdf import ZDFBaseIE
from ..compat import compat_str
from ..utils import (
    int_or_none,
    merge_dicts,
    try_get,
    unified_timestamp,
    urljoin,

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

import re

from .youtube import YoutubeIE
from .zdf import ZDFBaseIE
from ..compat import compat_str
from ..utils import (

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 18 Column: 1

              )


class PhoenixIE(ZDFBaseIE):
    IE_NAME = 'phoenix.de'
    _VALID_URL = r'https?://(?:www\.)?phoenix\.de/(?:[^/]+/)*[^/?#&]*-a-(?P<id>\d+)\.html'
    _TESTS = [{
        # Same as https://www.zdf.de/politik/phoenix-sendungen/wohin-fuehrt-der-protest-in-der-pandemie-100.html
        'url': 'https://www.phoenix.de/sendungen/ereignisse/corona-nachgehakt/wohin-fuehrt-der-protest-in-der-pandemie-a-2050630.html',

            

Reported by Pylint.

Missing class docstring
Error

Line: 18 Column: 1

              )


class PhoenixIE(ZDFBaseIE):
    IE_NAME = 'phoenix.de'
    _VALID_URL = r'https?://(?:www\.)?phoenix\.de/(?:[^/]+/)*[^/?#&]*-a-(?P<id>\d+)\.html'
    _TESTS = [{
        # Same as https://www.zdf.de/politik/phoenix-sendungen/wohin-fuehrt-der-protest-in-der-pandemie-100.html
        'url': 'https://www.phoenix.de/sendungen/ereignisse/corona-nachgehakt/wohin-fuehrt-der-protest-in-der-pandemie-a-2050630.html',

            

Reported by Pylint.

Line too long (112/100)
Error

Line: 22 Column: 1

                  IE_NAME = 'phoenix.de'
    _VALID_URL = r'https?://(?:www\.)?phoenix\.de/(?:[^/]+/)*[^/?#&]*-a-(?P<id>\d+)\.html'
    _TESTS = [{
        # Same as https://www.zdf.de/politik/phoenix-sendungen/wohin-fuehrt-der-protest-in-der-pandemie-100.html
        'url': 'https://www.phoenix.de/sendungen/ereignisse/corona-nachgehakt/wohin-fuehrt-der-protest-in-der-pandemie-a-2050630.html',
        'md5': '34ec321e7eb34231fd88616c65c92db0',
        'info_dict': {
            'id': '210222_phx_nachgehakt_corona_protest',
            'ext': 'mp4',

            

Reported by Pylint.

Line too long (135/100)
Error

Line: 23 Column: 1

                  _VALID_URL = r'https?://(?:www\.)?phoenix\.de/(?:[^/]+/)*[^/?#&]*-a-(?P<id>\d+)\.html'
    _TESTS = [{
        # Same as https://www.zdf.de/politik/phoenix-sendungen/wohin-fuehrt-der-protest-in-der-pandemie-100.html
        'url': 'https://www.phoenix.de/sendungen/ereignisse/corona-nachgehakt/wohin-fuehrt-der-protest-in-der-pandemie-a-2050630.html',
        'md5': '34ec321e7eb34231fd88616c65c92db0',
        'info_dict': {
            'id': '210222_phx_nachgehakt_corona_protest',
            'ext': 'mp4',
            'title': 'Wohin führt der Protest in der Pandemie?',

            

Reported by Pylint.

Line too long (111/100)
Error

Line: 39 Column: 1

                      },
    }, {
        # Youtube embed
        'url': 'https://www.phoenix.de/sendungen/gespraeche/phoenix-streitgut-brennglas-corona-a-1965505.html',
        'info_dict': {
            'id': 'hMQtqFYjomk',
            'ext': 'mp4',
            'title': 'phoenix streitgut: Brennglas Corona - Wie gerecht ist unsere Gesellschaft?',
            'description': 'md5:ac7a02e2eb3cb17600bc372e4ab28fdd',

            

Reported by Pylint.

youtube_dl/downloader/__init__.py
14 issues
Unable to import '__init__.common'
Error

Line: 3 Column: 1

              from __future__ import unicode_literals

from .common import FileDownloader
from .f4m import F4mFD
from .hls import HlsFD
from .http import HttpFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD

            

Reported by Pylint.

Unable to import '__init__.f4m'
Error

Line: 4 Column: 1

              from __future__ import unicode_literals

from .common import FileDownloader
from .f4m import F4mFD
from .hls import HlsFD
from .http import HttpFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD

            

Reported by Pylint.

Unable to import '__init__.hls'
Error

Line: 5 Column: 1

              
from .common import FileDownloader
from .f4m import F4mFD
from .hls import HlsFD
from .http import HttpFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD
from .ism import IsmFD

            

Reported by Pylint.

Unable to import '__init__.http'
Error

Line: 6 Column: 1

              from .common import FileDownloader
from .f4m import F4mFD
from .hls import HlsFD
from .http import HttpFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD
from .ism import IsmFD
from .external import (

            

Reported by Pylint.

Unable to import '__init__.rtmp'
Error

Line: 7 Column: 1

              from .f4m import F4mFD
from .hls import HlsFD
from .http import HttpFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD
from .ism import IsmFD
from .external import (
    get_external_downloader,

            

Reported by Pylint.

Unable to import '__init__.dash'
Error

Line: 8 Column: 1

              from .hls import HlsFD
from .http import HttpFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD
from .ism import IsmFD
from .external import (
    get_external_downloader,
    FFmpegFD,

            

Reported by Pylint.

Unable to import '__init__.rtsp'
Error

Line: 9 Column: 1

              from .http import HttpFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD
from .ism import IsmFD
from .external import (
    get_external_downloader,
    FFmpegFD,
)

            

Reported by Pylint.

Unable to import '__init__.ism'
Error

Line: 10 Column: 1

              from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD
from .ism import IsmFD
from .external import (
    get_external_downloader,
    FFmpegFD,
)


            

Reported by Pylint.

Unable to import '__init__.external'
Error

Line: 11 Column: 1

              from .dash import DashSegmentsFD
from .rtsp import RtspFD
from .ism import IsmFD
from .external import (
    get_external_downloader,
    FFmpegFD,
)

from ..utils import (

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

                  FFmpegFD,
)

from ..utils import (
    determine_protocol,
)

PROTOCOL_MAP = {
    'rtmp': RtmpFD,

            

Reported by Pylint.

devscripts/check-porn.py
14 issues
No name 'helper' in module 'test'
Error

Line: 17 Column: 1

              import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from test.helper import gettestcases
from youtube_dl.utils import compat_urllib_parse_urlparse
from youtube_dl.utils import compat_urllib_request

if len(sys.argv) > 1:
    METHOD = 'LIST'

            

Reported by Pylint.

Unable to import 'test.helper'
Error

Line: 17 Column: 1

              import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from test.helper import gettestcases
from youtube_dl.utils import compat_urllib_parse_urlparse
from youtube_dl.utils import compat_urllib_request

if len(sys.argv) > 1:
    METHOD = 'LIST'

            

Reported by Pylint.

Unable to import 'youtube_dl.utils'
Error

Line: 18 Column: 1

              sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from test.helper import gettestcases
from youtube_dl.utils import compat_urllib_parse_urlparse
from youtube_dl.utils import compat_urllib_request

if len(sys.argv) > 1:
    METHOD = 'LIST'
    LIST = open(sys.argv[1]).read().decode('utf8').strip()

            

Reported by Pylint.

Unable to import 'youtube_dl.utils'
Error

Line: 19 Column: 1

              
from test.helper import gettestcases
from youtube_dl.utils import compat_urllib_parse_urlparse
from youtube_dl.utils import compat_urllib_request

if len(sys.argv) > 1:
    METHOD = 'LIST'
    LIST = open(sys.argv[1]).read().decode('utf8').strip()
else:

            

Reported by Pylint.

String statement has no effect
Error

Line: 4 Column: 1

              #!/usr/bin/env python
from __future__ import unicode_literals

"""
This script employs a VERY basic heuristic ('porn' in webpage.lower()) to check
if we are not 'age_limit' tagging some porn site

A second approach implemented relies on a list of porn domains, to activate it
pass the list filename as the only argument

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 31 Column: 16

                  if METHOD == 'EURISTIC':
        try:
            webpage = compat_urllib_request.urlopen(test['url'], timeout=10).read()
        except Exception:
            print('\nFail: {0}'.format(test['name']))
            continue

        webpage = webpage.decode('utf8', 'replace')


            

Reported by Pylint.

Module name "check-porn" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              #!/usr/bin/env python
from __future__ import unicode_literals

"""
This script employs a VERY basic heuristic ('porn' in webpage.lower()) to check
if we are not 'age_limit' tagging some porn site

A second approach implemented relies on a list of porn domains, to activate it
pass the list filename as the only argument

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
from __future__ import unicode_literals

"""
This script employs a VERY basic heuristic ('porn' in webpage.lower()) to check
if we are not 'age_limit' tagging some porn site

A second approach implemented relies on a list of porn domains, to activate it
pass the list filename as the only argument

            

Reported by Pylint.

Import "import os" should be placed at the top of the module
Error

Line: 13 Column: 1

              """

# Allow direct execution
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from test.helper import gettestcases
from youtube_dl.utils import compat_urllib_parse_urlparse

            

Reported by Pylint.

Import "import sys" should be placed at the top of the module
Error

Line: 14 Column: 1

              
# Allow direct execution
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from test.helper import gettestcases
from youtube_dl.utils import compat_urllib_parse_urlparse
from youtube_dl.utils import compat_urllib_request

            

Reported by Pylint.

youtube_dl/extractor/storyfire.py
14 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              
import functools

from .common import InfoExtractor
from ..utils import (
    # HEADRequest,
    int_or_none,
    OnDemandPagedList,
    smuggle_url,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              import functools

from .common import InfoExtractor
from ..utils import (
    # HEADRequest,
    int_or_none,
    OnDemandPagedList,
    smuggle_url,
)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

import functools

from .common import InfoExtractor
from ..utils import (
    # HEADRequest,
    int_or_none,

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 15 Column: 1

              )


class StoryFireBaseIE(InfoExtractor):
    _VALID_URL_BASE = r'https?://(?:www\.)?storyfire\.com/'

    def _call_api(self, path, video_id, resource, query=None):
        return self._download_json(
            'https://storyfire.com/app/%s/%s' % (path, video_id), video_id,

            

Reported by Pylint.

Missing class docstring
Error

Line: 15 Column: 1

              )


class StoryFireBaseIE(InfoExtractor):
    _VALID_URL_BASE = r'https?://(?:www\.)?storyfire\.com/'

    def _call_api(self, path, video_id, resource, query=None):
        return self._download_json(
            'https://storyfire.com/app/%s/%s' % (path, video_id), video_id,

            

Reported by Pylint.

Line too long (104/100)
Error

Line: 32 Column: 1

                      # video_url = self._request_webpage(
        #    HEADRequest(video['vimeoVideoURL']), video_id).geturl()
        # formats = []
        # for v_url, suffix in [(video_url, '_sep'), (video_url.replace('/sep/video/', '/video/'), '')]:
        #    formats.extend(self._extract_m3u8_formats(
        #        v_url, video_id, 'mp4', 'm3u8_native',
        #        m3u8_id='hls' + suffix, fatal=False))
        #    formats.extend(self._extract_mpd_formats(
        #        v_url.replace('.m3u8', '.mpd'), video_id,

            

Reported by Pylint.

Line too long (105/100)
Error

Line: 63 Column: 1

                          'timestamp': int_or_none(video.get('publishDate')),
            'uploader': video.get('username'),
            'uploader_id': uploader_id,
            'uploader_url': 'https://storyfire.com/user/%s/video' % uploader_id if uploader_id else None,
            'episode_number': int_or_none(video.get('episodeNumber') or video.get('episode_number')),
        }


class StoryFireIE(StoryFireBaseIE):

            

Reported by Pylint.

Line too long (101/100)
Error

Line: 64 Column: 1

                          'uploader': video.get('username'),
            'uploader_id': uploader_id,
            'uploader_url': 'https://storyfire.com/user/%s/video' % uploader_id if uploader_id else None,
            'episode_number': int_or_none(video.get('episodeNumber') or video.get('episode_number')),
        }


class StoryFireIE(StoryFireBaseIE):
    _VALID_URL = StoryFireBaseIE._VALID_URL_BASE + r'video-details/(?P<id>[0-9a-f]{24})'

            

Reported by Pylint.

Missing class docstring
Error

Line: 68 Column: 1

                      }


class StoryFireIE(StoryFireBaseIE):
    _VALID_URL = StoryFireBaseIE._VALID_URL_BASE + r'video-details/(?P<id>[0-9a-f]{24})'
    _TEST = {
        'url': 'https://storyfire.com/video-details/5df1d132b6378700117f9181',
        'md5': 'caec54b9e4621186d6079c7ec100c1eb',
        'info_dict': {

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 68 Column: 1

                      }


class StoryFireIE(StoryFireBaseIE):
    _VALID_URL = StoryFireBaseIE._VALID_URL_BASE + r'video-details/(?P<id>[0-9a-f]{24})'
    _TEST = {
        'url': 'https://storyfire.com/video-details/5df1d132b6378700117f9181',
        'md5': 'caec54b9e4621186d6079c7ec100c1eb',
        'info_dict': {

            

Reported by Pylint.

youtube_dl/extractor/urplay.py
14 issues
Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

from .common import InfoExtractor
from ..utils import (
    dict_get,
    int_or_none,
    unified_timestamp,
)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              from __future__ import unicode_literals

from .common import InfoExtractor
from ..utils import (
    dict_get,
    int_or_none,
    unified_timestamp,
)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

from .common import InfoExtractor
from ..utils import (
    dict_get,
    int_or_none,
    unified_timestamp,
)

            

Reported by Pylint.

Missing class docstring
Error

Line: 12 Column: 1

              )


class URPlayIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?ur(?:play|skola)\.se/(?:program|Produkter)/(?P<id>[0-9]+)'
    _TESTS = [{
        'url': 'https://urplay.se/program/203704-ur-samtiden-livet-universum-och-rymdens-markliga-musik-om-vetenskap-kritiskt-tankande-och-motstand',
        'md5': 'ff5b0c89928f8083c74bbd5099c9292d',
        'info_dict': {

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 12 Column: 1

              )


class URPlayIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?ur(?:play|skola)\.se/(?:program|Produkter)/(?P<id>[0-9]+)'
    _TESTS = [{
        'url': 'https://urplay.se/program/203704-ur-samtiden-livet-universum-och-rymdens-markliga-musik-om-vetenskap-kritiskt-tankande-och-motstand',
        'md5': 'ff5b0c89928f8083c74bbd5099c9292d',
        'info_dict': {

            

Reported by Pylint.

Line too long (149/100)
Error

Line: 15 Column: 1

              class URPlayIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?ur(?:play|skola)\.se/(?:program|Produkter)/(?P<id>[0-9]+)'
    _TESTS = [{
        'url': 'https://urplay.se/program/203704-ur-samtiden-livet-universum-och-rymdens-markliga-musik-om-vetenskap-kritiskt-tankande-och-motstand',
        'md5': 'ff5b0c89928f8083c74bbd5099c9292d',
        'info_dict': {
            'id': '203704',
            'ext': 'mp4',
            'title': 'UR Samtiden - Livet, universum och rymdens märkliga musik : Om vetenskap, kritiskt tänkande och motstånd',

            

Reported by Pylint.

Line too long (128/100)
Error

Line: 20 Column: 1

                      'info_dict': {
            'id': '203704',
            'ext': 'mp4',
            'title': 'UR Samtiden - Livet, universum och rymdens märkliga musik : Om vetenskap, kritiskt tänkande och motstånd',
            'description': 'md5:5344508a52aa78c1ced6c1b8b9e44e9a',
            'timestamp': 1513292400,
            'upload_date': '20171214',
            'series': 'UR Samtiden - Livet, universum och rymdens märkliga musik',
            'duration': 2269,

            

Reported by Pylint.

Too many local variables (20/15)
Error

Line: 49 Column: 5

                      'only_matching': True,
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        url = url.replace('skola.se/Produkter', 'play.se/program')
        webpage = self._download_webpage(url, video_id)
        vid = int(video_id)
        accessible_episodes = self._parse_json(self._html_search_regex(

            

Reported by Pylint.

Line too long (125/100)
Error

Line: 55 Column: 1

                      webpage = self._download_webpage(url, video_id)
        vid = int(video_id)
        accessible_episodes = self._parse_json(self._html_search_regex(
            r'data-react-class="routes/Product/components/ProgramContainer/ProgramContainer"[^>]+data-react-props="({.+?})"',
            webpage, 'urplayer data'), video_id)['accessibleEpisodes']
        urplayer_data = next(e for e in accessible_episodes if e.get('id') == vid)
        episode = urplayer_data['title']
        raw_streaming_info = urplayer_data['streamingInfo']['raw']
        host = self._download_json(

            

Reported by Pylint.

Variable name "v" doesn't conform to snake_case naming style
Error

Line: 65 Column: 16

                          video_id)['redirect']

        formats = []
        for k, v in raw_streaming_info.items():
            if not (k in ('sd', 'hd') and isinstance(v, dict)):
                continue
            file_http = v.get('location')
            if file_http:
                formats.extend(self._extract_wowza_formats(

            

Reported by Pylint.

test/test_aes.py
14 issues
Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python

from __future__ import unicode_literals

# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

            

Reported by Pylint.

Line too long (103/100)
Error

Line: 11 Column: 1

              import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text
from youtube_dl.utils import bytes_to_intlist, intlist_to_bytes
import base64

# the encrypted data can be generate with 'devscripts/generate_aes_testdata.py'


            

Reported by Pylint.

Import "from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text" should be placed at the top of the module
Error

Line: 11 Column: 1

              import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text
from youtube_dl.utils import bytes_to_intlist, intlist_to_bytes
import base64

# the encrypted data can be generate with 'devscripts/generate_aes_testdata.py'


            

Reported by Pylint.

Import "from youtube_dl.utils import bytes_to_intlist, intlist_to_bytes" should be placed at the top of the module
Error

Line: 12 Column: 1

              sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text
from youtube_dl.utils import bytes_to_intlist, intlist_to_bytes
import base64

# the encrypted data can be generate with 'devscripts/generate_aes_testdata.py'



            

Reported by Pylint.

standard import "import base64" should be placed before "from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text"
Error

Line: 13 Column: 1

              
from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text
from youtube_dl.utils import bytes_to_intlist, intlist_to_bytes
import base64

# the encrypted data can be generate with 'devscripts/generate_aes_testdata.py'


class TestAES(unittest.TestCase):

            

Reported by Pylint.

Import "import base64" should be placed at the top of the module
Error

Line: 13 Column: 1

              
from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text
from youtube_dl.utils import bytes_to_intlist, intlist_to_bytes
import base64

# the encrypted data can be generate with 'devscripts/generate_aes_testdata.py'


class TestAES(unittest.TestCase):

            

Reported by Pylint.

Missing class docstring
Error

Line: 18 Column: 1

              # the encrypted data can be generate with 'devscripts/generate_aes_testdata.py'


class TestAES(unittest.TestCase):
    def setUp(self):
        self.key = self.iv = [0x20, 0x15] + 14 * [0]
        self.secret_msg = b'Secret message goes here'

    def test_encrypt(self):

            

Reported by Pylint.

Attribute name "iv" doesn't conform to snake_case naming style
Error

Line: 20 Column: 20

              
class TestAES(unittest.TestCase):
    def setUp(self):
        self.key = self.iv = [0x20, 0x15] + 14 * [0]
        self.secret_msg = b'Secret message goes here'

    def test_encrypt(self):
        msg = b'message'
        key = list(range(16))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 23 Column: 5

                      self.key = self.iv = [0x20, 0x15] + 14 * [0]
        self.secret_msg = b'Secret message goes here'

    def test_encrypt(self):
        msg = b'message'
        key = list(range(16))
        encrypted = aes_encrypt(bytes_to_intlist(msg), key)
        decrypted = intlist_to_bytes(aes_decrypt(encrypted, key))
        self.assertEqual(decrypted, msg)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 30 Column: 5

                      decrypted = intlist_to_bytes(aes_decrypt(encrypted, key))
        self.assertEqual(decrypted, msg)

    def test_cbc_decrypt(self):
        data = bytes_to_intlist(
            b"\x97\x92+\xe5\x0b\xc3\x18\x91ky9m&\xb3\xb5@\xe6'\xc2\x96.\xc8u\x88\xab9-[\x9e|\xf1\xcd"
        )
        decrypted = intlist_to_bytes(aes_cbc_decrypt(data, self.key, self.iv))
        self.assertEqual(decrypted.rstrip(b'\x08'), self.secret_msg)

            

Reported by Pylint.

youtube_dl/extractor/weibo.py
14 issues
Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

from .common import InfoExtractor

import json
import random
import re


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              import random
import re

from ..compat import (
    compat_parse_qs,
    compat_str,
)
from ..utils import (
    js_to_json,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

                  compat_parse_qs,
    compat_str,
)
from ..utils import (
    js_to_json,
    strip_jsonp,
    urlencode_postdata,
)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

from .common import InfoExtractor

import json
import random
import re


            

Reported by Pylint.

standard import "import json" should be placed before "from .common import InfoExtractor"
Error

Line: 6 Column: 1

              
from .common import InfoExtractor

import json
import random
import re

from ..compat import (
    compat_parse_qs,

            

Reported by Pylint.

standard import "import random" should be placed before "from .common import InfoExtractor"
Error

Line: 7 Column: 1

              from .common import InfoExtractor

import json
import random
import re

from ..compat import (
    compat_parse_qs,
    compat_str,

            

Reported by Pylint.

standard import "import re" should be placed before "from .common import InfoExtractor"
Error

Line: 8 Column: 1

              
import json
import random
import re

from ..compat import (
    compat_parse_qs,
    compat_str,
)

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 21 Column: 1

              )


class WeiboIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?weibo\.com/[0-9]+/(?P<id>[a-zA-Z0-9]+)'
    _TEST = {
        'url': 'https://weibo.com/6275294458/Fp6RGfbff?type=comment',
        'info_dict': {
            'id': 'Fp6RGfbff',

            

Reported by Pylint.

Missing class docstring
Error

Line: 21 Column: 1

              )


class WeiboIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?weibo\.com/[0-9]+/(?P<id>[a-zA-Z0-9]+)'
    _TEST = {
        'url': 'https://weibo.com/6275294458/Fp6RGfbff?type=comment',
        'info_dict': {
            'id': 'Fp6RGfbff',

            

Reported by Pylint.

Too many local variables (17/15)
Error

Line: 32 Column: 5

                      }
    }

    def _real_extract(self, url):
        video_id = self._match_id(url)
        # to get Referer url for genvisitor
        webpage, urlh = self._download_webpage_handle(url, video_id)

        visitor_url = urlh.geturl()

            

Reported by Pylint.

youtube_dl/extractor/steam.py
14 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              
import re

from .common import InfoExtractor
from ..utils import (
    extract_attributes,
    ExtractorError,
    get_element_by_class,
    js_to_json,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              import re

from .common import InfoExtractor
from ..utils import (
    extract_attributes,
    ExtractorError,
    get_element_by_class,
    js_to_json,
)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import unicode_literals

import re

from .common import InfoExtractor
from ..utils import (
    extract_attributes,
    ExtractorError,
    get_element_by_class,

            

Reported by Pylint.

Missing class docstring
Error

Line: 14 Column: 1

              )


class SteamIE(InfoExtractor):
    _VALID_URL = r"""(?x)
        https?://store\.steampowered\.com/
            (agecheck/)?
            (?P<urltype>video|app)/ #If the page is only for videos or for a game
            (?P<gameID>\d+)/?

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 14 Column: 1

              )


class SteamIE(InfoExtractor):
    _VALID_URL = r"""(?x)
        https?://store\.steampowered\.com/
            (agecheck/)?
            (?P<urltype>video|app)/ #If the page is only for videos or for a game
            (?P<gameID>\d+)/?

            

Reported by Pylint.

Line too long (148/100)
Error

Line: 25 Column: 1

                      https?://(?:www\.)?steamcommunity\.com/sharedfiles/filedetails/\?id=(?P<fileID>[0-9]+)
    """
    _VIDEO_PAGE_TEMPLATE = 'http://store.steampowered.com/video/%s/'
    _AGECHECK_TEMPLATE = 'http://store.steampowered.com/agecheck/video/%s/?snr=1_agecheck_agecheck__age-gate&ageDay=1&ageMonth=January&ageYear=1970'
    _TESTS = [{
        'url': 'http://store.steampowered.com/video/105600/',
        'playlist': [
            {
                'md5': '6a294ee0c4b1f47f5bb76a65e31e3592',

            

Reported by Pylint.

Too many local variables (24/15)
Error

Line: 68 Column: 5

                      }
    }]

    def _real_extract(self, url):
        m = re.match(self._VALID_URL, url)
        fileID = m.group('fileID')
        if fileID:
            videourl = url
            playlist_id = fileID

            

Reported by Pylint.

Too many branches (19/12)
Error

Line: 68 Column: 5

                      }
    }]

    def _real_extract(self, url):
        m = re.match(self._VALID_URL, url)
        fileID = m.group('fileID')
        if fileID:
            videourl = url
            playlist_id = fileID

            

Reported by Pylint.

Too many statements (54/50)
Error

Line: 68 Column: 5

                      }
    }]

    def _real_extract(self, url):
        m = re.match(self._VALID_URL, url)
        fileID = m.group('fileID')
        if fileID:
            videourl = url
            playlist_id = fileID

            

Reported by Pylint.

Variable name "m" doesn't conform to snake_case naming style
Error

Line: 69 Column: 9

                  }]

    def _real_extract(self, url):
        m = re.match(self._VALID_URL, url)
        fileID = m.group('fileID')
        if fileID:
            videourl = url
            playlist_id = fileID
        else:

            

Reported by Pylint.

youtube_dl/extractor/atresplayer.py
14 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              
import re

from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
    ExtractorError,
    int_or_none,
    urlencode_postdata,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              import re

from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
    ExtractorError,
    int_or_none,
    urlencode_postdata,
)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
    ExtractorError,
    int_or_none,
    urlencode_postdata,
)


            

Reported by Pylint.

The raise statement is not inside an except clause
Error

Line: 53 Column: 9

                          if error.get('error') == 'required_registered':
                self.raise_login_required()
            raise ExtractorError(error['error_description'], expected=True)
        raise

    def _login(self):
        username, password = self._get_login_info()
        if username is None:
            return

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

import re

from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
    ExtractorError,

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 15 Column: 1

              )


class AtresPlayerIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?atresplayer\.com/[^/]+/[^/]+/[^/]+/[^/]+/(?P<display_id>.+?)_(?P<id>[0-9a-f]{24})'
    _NETRC_MACHINE = 'atresplayer'
    _TESTS = [
        {
            'url': 'https://www.atresplayer.com/antena3/series/pequenas-coincidencias/temporada-1/capitulo-7-asuntos-pendientes_5d4aa2c57ed1a88fc715a615/',

            

Reported by Pylint.

Missing class docstring
Error

Line: 15 Column: 1

              )


class AtresPlayerIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?atresplayer\.com/[^/]+/[^/]+/[^/]+/[^/]+/(?P<display_id>.+?)_(?P<id>[0-9a-f]{24})'
    _NETRC_MACHINE = 'atresplayer'
    _TESTS = [
        {
            'url': 'https://www.atresplayer.com/antena3/series/pequenas-coincidencias/temporada-1/capitulo-7-asuntos-pendientes_5d4aa2c57ed1a88fc715a615/',

            

Reported by Pylint.

Line too long (120/100)
Error

Line: 16 Column: 1

              

class AtresPlayerIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?atresplayer\.com/[^/]+/[^/]+/[^/]+/[^/]+/(?P<display_id>.+?)_(?P<id>[0-9a-f]{24})'
    _NETRC_MACHINE = 'atresplayer'
    _TESTS = [
        {
            'url': 'https://www.atresplayer.com/antena3/series/pequenas-coincidencias/temporada-1/capitulo-7-asuntos-pendientes_5d4aa2c57ed1a88fc715a615/',
            'info_dict': {

            

Reported by Pylint.

Line too long (155/100)
Error

Line: 20 Column: 1

                  _NETRC_MACHINE = 'atresplayer'
    _TESTS = [
        {
            'url': 'https://www.atresplayer.com/antena3/series/pequenas-coincidencias/temporada-1/capitulo-7-asuntos-pendientes_5d4aa2c57ed1a88fc715a615/',
            'info_dict': {
                'id': '5d4aa2c57ed1a88fc715a615',
                'ext': 'mp4',
                'title': 'Capítulo 7: Asuntos pendientes',
                'description': 'md5:7634cdcb4d50d5381bedf93efb537fbc',

            

Reported by Pylint.

Line too long (169/100)
Error

Line: 34 Column: 1

                          'skip': 'This video is only available for registered users'
        },
        {
            'url': 'https://www.atresplayer.com/lasexta/programas/el-club-de-la-comedia/temporada-4/capitulo-10-especial-solidario-nochebuena_5ad08edf986b2855ed47adc4/',
            'only_matching': True,
        },
        {
            'url': 'https://www.atresplayer.com/antena3/series/el-secreto-de-puente-viejo/el-chico-de-los-tres-lunares/capitulo-977-29-12-14_5ad51046986b2886722ccdea/',
            'only_matching': True,

            

Reported by Pylint.