The following issues were found

test/test_subtitles.py
66 issues
self.IE is not callable
Error

Line: 39 Column: 19

              
    def setUp(self):
        self.DL = FakeYDL()
        self.ie = self.IE()
        self.DL.add_info_extractor(self.ie)

    def getInfoDict(self):
        info_dict = self.DL.extract_info(self.url, download=False)
        return info_dict

            

Reported by Pylint.

Unreachable code
Error

Line: 325 Column: 9

                  def test_allsubtitles(self):
        print('Skipping, only available from Spain')
        return
        self.DL.params['writesubtitles'] = True
        self.DL.params['allsubtitles'] = True
        subtitles = self.getSubtitles()
        self.assertEqual(set(subtitles.keys()), set(['es']))
        self.assertEqual(md5(subtitles['es']), '69e70cae2d40574fb7316f31d6eb7fca')


            

Reported by Pylint.

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.

Import "from test.helper import FakeYDL, md5" should be placed at the top of the module
Error

Line: 10 Column: 1

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

from test.helper import FakeYDL, md5


from youtube_dl.extractor import (
    YoutubeIE,
    DailymotionIE,

            

Reported by Pylint.

Import "from youtube_dl.extractor import YoutubeIE, DailymotionIE, TEDIE, VimeoIE, WallaIE, CeskaTelevizeIE, LyndaIE, NPOIE, ComedyCentralIE, NRKTVIE, RaiPlayIE, VikiIE, ThePlatformIE, ThePlatformFeedIE, RTVEALaCartaIE, DemocracynowIE" should be placed at the top of the module
Error

Line: 13 Column: 1

              from test.helper import FakeYDL, md5


from youtube_dl.extractor import (
    YoutubeIE,
    DailymotionIE,
    TEDIE,
    VimeoIE,
    WallaIE,

            

Reported by Pylint.

Missing class docstring
Error

Line: 33 Column: 1

              )


class BaseTestSubtitles(unittest.TestCase):
    url = None
    IE = None

    def setUp(self):
        self.DL = FakeYDL()

            

Reported by Pylint.

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

Line: 38 Column: 9

                  IE = None

    def setUp(self):
        self.DL = FakeYDL()
        self.ie = self.IE()
        self.DL.add_info_extractor(self.ie)

    def getInfoDict(self):
        info_dict = self.DL.extract_info(self.url, download=False)

            

Reported by Pylint.

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

Line: 39 Column: 9

              
    def setUp(self):
        self.DL = FakeYDL()
        self.ie = self.IE()
        self.DL.add_info_extractor(self.ie)

    def getInfoDict(self):
        info_dict = self.DL.extract_info(self.url, download=False)
        return info_dict

            

Reported by Pylint.

Method name "getInfoDict" doesn't conform to snake_case naming style
Error

Line: 42 Column: 5

                      self.ie = self.IE()
        self.DL.add_info_extractor(self.ie)

    def getInfoDict(self):
        info_dict = self.DL.extract_info(self.url, download=False)
        return info_dict

    def getSubtitles(self):
        info_dict = self.getInfoDict()

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 42 Column: 5

                      self.ie = self.IE()
        self.DL.add_info_extractor(self.ie)

    def getInfoDict(self):
        info_dict = self.DL.extract_info(self.url, download=False)
        return info_dict

    def getSubtitles(self):
        info_dict = self.getInfoDict()

            

Reported by Pylint.

youtube_dl/extractor/vimeo.py
63 issues
Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import re
import itertools

from .common import InfoExtractor
from ..compat import (
    compat_kwargs,
    compat_HTTPError,
    compat_str,
    compat_urlparse,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              import itertools

from .common import InfoExtractor
from ..compat import (
    compat_kwargs,
    compat_HTTPError,
    compat_str,
    compat_urlparse,
)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

                  compat_str,
    compat_urlparse,
)
from ..utils import (
    clean_html,
    determine_ext,
    ExtractorError,
    get_element_by_class,
    js_to_json,

            

Reported by Pylint.

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

Line: 71 Column: 17

                              })
        except ExtractorError as e:
            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 418:
                raise ExtractorError(
                    'Unable to log in: bad username or password',
                    expected=True)
            raise ExtractorError('Unable to log in')

    def _get_video_password(self):

            

Reported by Pylint.

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

Line: 74 Column: 13

                              raise ExtractorError(
                    'Unable to log in: bad username or password',
                    expected=True)
            raise ExtractorError('Unable to log in')

    def _get_video_password(self):
        password = self._downloader.params.get('videopassword')
        if password is None:
            raise ExtractorError(

            

Reported by Pylint.

TODO: fix handling of 308 status code returned for live archive manifest requests
Error

Line: 145 Column: 3

                              'tbr': int_or_none(f.get('bitrate')),
            })

        # TODO: fix handling of 308 status code returned for live archive manifest requests
        sep_pattern = r'/sep/video/'
        for files_type in ('hls', 'dash'):
            for cdn_name, cdn_data in (try_get(config_files, lambda x: x[files_type]['cdns']) or {}).items():
                manifest_url = cdn_data.get('url')
                if not manifest_url:

            

Reported by Pylint.

Cell variable files_type defined in loop
Error

Line: 148 Column: 74

                      # TODO: fix handling of 308 status code returned for live archive manifest requests
        sep_pattern = r'/sep/video/'
        for files_type in ('hls', 'dash'):
            for cdn_name, cdn_data in (try_get(config_files, lambda x: x[files_type]['cdns']) or {}).items():
                manifest_url = cdn_data.get('url')
                if not manifest_url:
                    continue
                format_id = '%s-%s' % (files_type, cdn_name)
                sep_manifest_urls = []

            

Reported by Pylint.

Cell variable k defined in loop
Error

Line: 607 Column: 79

                      connections = try_get(
            video, lambda x: x['metadata']['connections'], dict) or {}
        for k in ('comment', 'like'):
            info[k + '_count'] = int_or_none(try_get(connections, lambda x: x[k + 's']['total']))
        return info

    def _real_extract(self, url):
        url, data = unsmuggle_url(url, {})
        headers = std_headers.copy()

            

Reported by Pylint.

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

Line: 643 Column: 21

                          if isinstance(ee.cause, compat_HTTPError) and ee.cause.code == 403:
                errmsg = ee.cause.read()
                if b'Because of its privacy settings, this video cannot be played here' in errmsg:
                    raise ExtractorError(
                        'Cannot download embed-only video without embedding '
                        'URL. Please call youtube-dl with the URL of the page '
                        'that embeds this video.',
                        expected=True)
            raise

            

Reported by Pylint.

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

Line: 987 Column: 21

                                  })['hashed_pass']
            except ExtractorError as e:
                if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
                    raise ExtractorError('Wrong password', expected=True)
                raise
        entries = OnDemandPagedList(functools.partial(
            self._fetch_page, album_id, jwt, hashed_pass), self._PAGE_SIZE)
        return self.playlist_result(
            entries, album_id, album.get('name'), album.get('description'))

            

Reported by Pylint.

youtube_dl/extractor/npo.py
61 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              
import re

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

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              import re

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

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

                  compat_HTTPError,
    compat_str,
)
from ..utils import (
    determine_ext,
    ExtractorError,
    fix_xml_ampersands,
    int_or_none,
    merge_dicts,

            

Reported by Pylint.

Cell variable item_label defined in loop
Error

Line: 359 Column: 20

                                  r'(\d+)[xX]\d+', format_url, 'width', default=None))
                height = int_or_none(self._search_regex(
                    r'\d+[xX](\d+)', format_url, 'height', default=None))
                if item_label in QUALITY_LABELS:
                    quality = quality_from_label(item_label)
                    f_id = item_label
                elif item_label in QUALITY_FORMATS:
                    quality = quality_from_format_id(format_id)
                    f_id = format_id

            

Reported by Pylint.

Cell variable item_label defined in loop
Error

Line: 360 Column: 50

                              height = int_or_none(self._search_regex(
                    r'\d+[xX](\d+)', format_url, 'height', default=None))
                if item_label in QUALITY_LABELS:
                    quality = quality_from_label(item_label)
                    f_id = item_label
                elif item_label in QUALITY_FORMATS:
                    quality = quality_from_format_id(format_id)
                    f_id = format_id
                else:

            

Reported by Pylint.

Cell variable item_label defined in loop
Error

Line: 361 Column: 28

                                  r'\d+[xX](\d+)', format_url, 'height', default=None))
                if item_label in QUALITY_LABELS:
                    quality = quality_from_label(item_label)
                    f_id = item_label
                elif item_label in QUALITY_FORMATS:
                    quality = quality_from_format_id(format_id)
                    f_id = format_id
                else:
                    quality, f_id = [None] * 2

            

Reported by Pylint.

Cell variable item_label defined in loop
Error

Line: 362 Column: 22

                              if item_label in QUALITY_LABELS:
                    quality = quality_from_label(item_label)
                    f_id = item_label
                elif item_label in QUALITY_FORMATS:
                    quality = quality_from_format_id(format_id)
                    f_id = format_id
                else:
                    quality, f_id = [None] * 2
                formats.append({

            

Reported by Pylint.

Cell variable format_id defined in loop
Error

Line: 363 Column: 54

                                  quality = quality_from_label(item_label)
                    f_id = item_label
                elif item_label in QUALITY_FORMATS:
                    quality = quality_from_format_id(format_id)
                    f_id = format_id
                else:
                    quality, f_id = [None] * 2
                formats.append({
                    'url': format_url,

            

Reported by Pylint.

Cell variable format_id defined in loop
Error

Line: 364 Column: 28

                                  f_id = item_label
                elif item_label in QUALITY_FORMATS:
                    quality = quality_from_format_id(format_id)
                    f_id = format_id
                else:
                    quality, f_id = [None] * 2
                formats.append({
                    'url': format_url,
                    'format_id': f_id,

            

Reported by Pylint.

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

Line: 391 Column: 25

                                      ee.cause.read().decode(), video_id,
                        fatal=False) or {}).get('errorstring')
                    if error:
                        raise ExtractorError(error, expected=True)
                raise
            # Stream URL instead of JSON, example: npo:LI_NL1_4188102
            if isinstance(stream_info, compat_str):
                if not stream_info.startswith('http'):
                    continue

            

Reported by Pylint.

youtube_dl/extractor/nexx.py
59 issues
Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import re
import time

from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
    ExtractorError,
    int_or_none,
    parse_duration,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              import time

from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
    ExtractorError,
    int_or_none,
    parse_duration,
    try_get,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
    ExtractorError,
    int_or_none,
    parse_duration,
    try_get,
    urlencode_postdata,

            

Reported by Pylint.

TODO: support more embed formats
Error

Line: 132 Column: 3

                                  'https://api.nexx.cloud/v3/%s/videos/byid/%s'
                    % (domain_id, video_id))

        # TODO: support more embed formats

        return entries

    @staticmethod
    def _extract_url(webpage):

            

Reported by Pylint.

Dangerous default value {} as argument
Error

Line: 149 Column: 5

                          '%s said: %s' % (self.IE_NAME, response['metadata']['errorhint']),
            expected=True)

    def _call_api(self, domain_id, path, video_id, data=None, headers={}):
        headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
        result = self._download_json(
            'https://api.nexx.cloud/v3/%s/%s' % (domain_id, path), video_id,
            'Downloading %s JSON' % path, data=urlencode_postdata(data),
            headers=headers)

            

Reported by Pylint.

Redefining built-in 'hash'
Error

Line: 163 Column: 9

                      cdn = stream_data['cdnType']
        assert cdn == 'free'

        hash = video['general']['hash']

        ps = compat_str(stream_data['originalDomain'])
        if stream_data['applyFolderHierarchy'] == 1:
            s = ('%04d' % int(video_id))[::-1]
            ps += '/%s/%s' % (s[0:2], s[2:4])

            

Reported by Pylint.

Else clause on loop without a break statement
Error

Line: 235 Column: 13

                              cdn_shield = stream_data.get('cdnShield%sHTTP%s' % (shield_type, secure.upper()))
                if cdn_shield:
                    return 'http%s://%s' % (secure, cdn_shield)
            else:
                if 'fb' in stream_data['azureAccount']:
                    prefix = 'df' if static else 'f'
                else:
                    prefix = 'd' if static else 'p'
                account = int(stream_data['azureAccount'].replace('nexxplayplus', '').replace('nexxplayfb', ''))

            

Reported by Pylint.

Use of insecure MD2, MD4, MD5, or SHA1 hash function.
Security blacklist

Line: 358
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b303-md5

              
            # Reversed from JS code for _play.api.call function (search for
            # X-Request-Token)
            request_token = hashlib.md5(
                ''.join((op, domain_id, secret)).encode('utf-8')).hexdigest()

            result = self._call_api(
                domain_id, 'videos/%s/%s' % (op, video_id), video_id, data={
                    'additionalfields': 'language,channel,actors,studio,licenseby,slug,subtitle,teaser,description',

            

Reported by Bandit.

TODO: reverse more cdns
Error

Line: 388 Column: 3

                      elif cdn == 'free':
            formats = self._extract_free_formats(video, video_id)
        else:
            # TODO: reverse more cdns
            assert False

        self._sort_formats(formats)

        return {

            

Reported by Pylint.

Access to a protected member _extract_url of a client class
Error

Line: 453 Column: 32

              
        webpage = self._download_webpage(url, embed_id)

        return self.url_result(NexxIE._extract_url(webpage), ie=NexxIE.ie_key())

            

Reported by Pylint.

youtube_dl/extractor/zattoo.py
58 issues
Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              import re
from uuid import uuid4

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

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              from uuid import uuid4

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

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

                  compat_HTTPError,
    compat_str,
)
from ..utils import (
    ExtractorError,
    int_or_none,
    try_get,
    url_or_none,
    urlencode_postdata,

            

Reported by Pylint.

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

Line: 47 Column: 17

                              })
        except ExtractorError as e:
            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 400:
                raise ExtractorError(
                    'Unable to login: incorrect username and/or password',
                    expected=True)
            raise

        self._power_guide_hash = data['session']['power_guide_hash']

            

Reported by Pylint.

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

Line: 92 Column: 13

                                  chan.get('display_alias') == channel_name
                    or chan.get('cid') == channel_name))
        except StopIteration:
            raise ExtractorError('Could not extract channel id')

    def _extract_cid_and_video_info(self, video_id):
        data = self._download_json(
            '%s/zapi/v2/cached/program/power_details/%s' % (
                self._host_url(), self._power_guide_hash),

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

import re
from uuid import uuid4

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

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 21 Column: 1

              )


class ZattooPlatformBaseIE(InfoExtractor):
    _power_guide_hash = None

    def _host_url(self):
        return 'https://%s' % (self._API_HOST if hasattr(self, '_API_HOST') else self._HOST)


            

Reported by Pylint.

Missing class docstring
Error

Line: 21 Column: 1

              )


class ZattooPlatformBaseIE(InfoExtractor):
    _power_guide_hash = None

    def _host_url(self):
        return 'https://%s' % (self._API_HOST if hasattr(self, '_API_HOST') else self._HOST)


            

Reported by Pylint.

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

Line: 45 Column: 9

                                  'Referer': '%s/login' % self._host_url(),
                    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
                })
        except ExtractorError as e:
            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 400:
                raise ExtractorError(
                    'Unable to login: incorrect username and/or password',
                    expected=True)
            raise

            

Reported by Pylint.

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

Line: 105 Column: 9

                              'complete': True,
            })

        p = data['programs'][0]
        cid = p['cid']

        info_dict = {
            'id': video_id,
            'title': p.get('t') or p['et'],

            

Reported by Pylint.

youtube_dl/extractor/facebook.py
57 issues
Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              import re
import socket

from .common import InfoExtractor
from ..compat import (
    compat_etree_fromstring,
    compat_http_client,
    compat_str,
    compat_urllib_error,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import socket

from .common import InfoExtractor
from ..compat import (
    compat_etree_fromstring,
    compat_http_client,
    compat_str,
    compat_urllib_error,
    compat_urllib_parse_unquote,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 17 Column: 1

                  compat_urllib_parse_unquote,
    compat_urllib_parse_unquote_plus,
)
from ..utils import (
    clean_html,
    error_to_compat_str,
    ExtractorError,
    float_or_none,
    get_element_by_id,

            

Reported by Pylint.

TODO: title can be extracted from video page
Error

Line: 264 Column: 3

                      'info_dict': {
            'id': '117576630041613',
            'ext': 'mp4',
            # TODO: title can be extracted from video page
            'title': 'Facebook video #117576630041613',
            'uploader_id': '189393014416438',
            'upload_date': '20201123',
            'timestamp': 1606162592,
        },

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

import json
import re
import socket

from .common import InfoExtractor
from ..compat import (

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 35 Column: 1

              )


class FacebookIE(InfoExtractor):
    _VALID_URL = r'''(?x)
                (?:
                    https?://
                        (?:[\w-]+\.)?(?:facebook\.com|facebookcorewwwi\.onion)/
                        (?:[^#]*?\#!/)?

            

Reported by Pylint.

Missing class docstring
Error

Line: 35 Column: 1

              )


class FacebookIE(InfoExtractor):
    _VALID_URL = r'''(?x)
                (?:
                    https?://
                        (?:[\w-]+\.)?(?:facebook\.com|facebookcorewwwi\.onion)/
                        (?:[^#]*?\#!/)?

            

Reported by Pylint.

Line too long (111/100)
Error

Line: 59 Column: 1

                              )
                (?P<id>[0-9]+)
                '''
    _LOGIN_URL = 'https://www.facebook.com/login.php?next=http%3A%2F%2Ffacebook.com%2Fhome.php&login_attempt=1'
    _CHECKPOINT_URL = 'https://www.facebook.com/checkpoint/?next=http%3A%2F%2Ffacebook.com%2Fhome.php&_fb_noscript=1'
    _NETRC_MACHINE = 'facebook'
    IE_NAME = 'facebook'

    _VIDEO_PAGE_TEMPLATE = 'https://www.facebook.com/video/video.php?v=%s'

            

Reported by Pylint.

Line too long (117/100)
Error

Line: 60 Column: 1

                              (?P<id>[0-9]+)
                '''
    _LOGIN_URL = 'https://www.facebook.com/login.php?next=http%3A%2F%2Ffacebook.com%2Fhome.php&login_attempt=1'
    _CHECKPOINT_URL = 'https://www.facebook.com/checkpoint/?next=http%3A%2F%2Ffacebook.com%2Fhome.php&_fb_noscript=1'
    _NETRC_MACHINE = 'facebook'
    IE_NAME = 'facebook'

    _VIDEO_PAGE_TEMPLATE = 'https://www.facebook.com/video/video.php?v=%s'
    _VIDEO_PAGE_TAHOE_TEMPLATE = 'https://www.facebook.com/video/tahoe/async/%s/?chain=true&isvideo=true&payloadtype=primary'

            

Reported by Pylint.

Line too long (125/100)
Error

Line: 65 Column: 1

                  IE_NAME = 'facebook'

    _VIDEO_PAGE_TEMPLATE = 'https://www.facebook.com/video/video.php?v=%s'
    _VIDEO_PAGE_TAHOE_TEMPLATE = 'https://www.facebook.com/video/tahoe/async/%s/?chain=true&isvideo=true&payloadtype=primary'

    _TESTS = [{
        'url': 'https://www.facebook.com/video.php?v=637842556329505&fref=nf',
        'md5': '6a40d33c0eccbb1af76cf0485a052659',
        'info_dict': {

            

Reported by Pylint.

youtube_dl/extractor/orf.py
55 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              
import re

from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
    clean_html,
    determine_ext,
    float_or_none,

            

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_str
from ..utils import (
    clean_html,
    determine_ext,
    float_or_none,
    HEADRequest,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
    clean_html,
    determine_ext,
    float_or_none,
    HEADRequest,
    int_or_none,

            

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_str
from ..utils import (
    clean_html,

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 24 Column: 1

              )


class ORFTVthekIE(InfoExtractor):
    IE_NAME = 'orf:tvthek'
    IE_DESC = 'ORF TVthek'
    _VALID_URL = r'https?://tvthek\.orf\.at/(?:[^/]+/)+(?P<id>\d+)'

    _TESTS = [{

            

Reported by Pylint.

Missing class docstring
Error

Line: 24 Column: 1

              )


class ORFTVthekIE(InfoExtractor):
    IE_NAME = 'orf:tvthek'
    IE_DESC = 'ORF TVthek'
    _VALID_URL = r'https?://tvthek\.orf\.at/(?:[^/]+/)+(?P<id>\d+)'

    _TESTS = [{

            

Reported by Pylint.

Line too long (117/100)
Error

Line: 30 Column: 1

                  _VALID_URL = r'https?://tvthek\.orf\.at/(?:[^/]+/)+(?P<id>\d+)'

    _TESTS = [{
        'url': 'http://tvthek.orf.at/program/Aufgetischt/2745173/Aufgetischt-Mit-der-Steirischen-Tafelrunde/8891389',
        'playlist': [{
            'md5': '2942210346ed779588f428a92db88712',
            'info_dict': {
                'id': '8896777',
                'ext': 'mp4',

            

Reported by Pylint.

Line too long (103/100)
Error

Line: 44 Column: 1

                      }],
        'skip': 'Blocked outside of Austria / Germany',
    }, {
        'url': 'http://tvthek.orf.at/topic/Im-Wandel-der-Zeit/8002126/Best-of-Ingrid-Thurnher/7982256',
        'info_dict': {
            'id': '7982259',
            'ext': 'mp4',
            'title': 'Best of Ingrid Thurnher',
            'upload_date': '20140527',

            

Reported by Pylint.

Line too long (222/100)
Error

Line: 50 Column: 1

                          'ext': 'mp4',
            'title': 'Best of Ingrid Thurnher',
            'upload_date': '20140527',
            'description': 'Viele Jahre war Ingrid Thurnher das "Gesicht" der ZIB 2. Vor ihrem Wechsel zur ZIB 2 im Jahr 1995 moderierte sie unter anderem "Land und Leute", "Österreich-Bild" und "Niederösterreich heute".',
        },
        'params': {
            'skip_download': True,  # rtsp downloads
        },
        'skip': 'Blocked outside of Austria / Germany',

            

Reported by Pylint.

Line too long (144/100)
Error

Line: 57 Column: 1

                      },
        'skip': 'Blocked outside of Austria / Germany',
    }, {
        'url': 'http://tvthek.orf.at/topic/Fluechtlingskrise/10463081/Heimat-Fremde-Heimat/13879132/Senioren-betreuen-Migrantenkinder/13879141',
        'only_matching': True,
    }, {
        'url': 'http://tvthek.orf.at/profile/Universum/35429',
        'only_matching': True,
    }]

            

Reported by Pylint.

youtube_dl/extractor/twitter.py
54 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              
import re

from .common import InfoExtractor
from ..compat import (
    compat_HTTPError,
    compat_parse_qs,
    compat_urllib_parse_unquote,
    compat_urllib_parse_urlparse,

            

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,
    compat_parse_qs,
    compat_urllib_parse_unquote,
    compat_urllib_parse_urlparse,
)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

                  compat_urllib_parse_unquote,
    compat_urllib_parse_urlparse,
)
from ..utils import (
    dict_get,
    ExtractorError,
    float_or_none,
    int_or_none,
    try_get,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 26 Column: 1

                  xpath_text,
)

from .periscope import (
    PeriscopeBaseIE,
    PeriscopeIE,
)



            

Reported by Pylint.

Dangerous default value {} as argument
Error

Line: 82 Column: 5

                              'height': int(m.group('height')),
            })

    def _call_api(self, path, video_id, query={}):
        headers = {
            'Authorization': 'Bearer AAAAAAAAAAAAAAAAAAAAAPYXBAAAAAAACLXUNDekMxqa8h%2F40K4moUkGsoc%3DTYfbDKbT3jJPCEVnMYqilB28NHfOPqkca3qaAxGfsyKCs0wRbw',
        }
        if not self._GUEST_TOKEN:
            self._GUEST_TOKEN = self._download_json(

            

Reported by Pylint.

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

Line: 97 Column: 17

                              self._API_BASE + path, video_id, headers=headers, query=query)
        except ExtractorError as e:
            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:
                raise ExtractorError(self._parse_json(
                    e.cause.read().decode(),
                    video_id)['errors'][0]['message'], expected=True)
            raise



            

Reported by Pylint.

Access to a protected member _BASE_REGEX of a client class
Error

Line: 105 Column: 18

              
class TwitterCardIE(InfoExtractor):
    IE_NAME = 'twitter:card'
    _VALID_URL = TwitterBaseIE._BASE_REGEX + r'i/(?:cards/tfw/v1|videos(?:/tweet)?)/(?P<id>\d+)'
    _TESTS = [
        {
            'url': 'https://twitter.com/i/cards/tfw/v1/560070183650213889',
            # MD5 checksums are different in different places
            'info_dict': {

            

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,
    compat_parse_qs,

            

Reported by Pylint.

Missing class docstring
Error

Line: 32 Column: 1

              )


class TwitterBaseIE(InfoExtractor):
    _API_BASE = 'https://api.twitter.com/1.1/'
    _BASE_REGEX = r'https?://(?:(?:www|m(?:obile)?)\.)?twitter\.com/'
    _GUEST_TOKEN = None

    def _extract_variant_formats(self, variant, video_id):

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 32 Column: 1

              )


class TwitterBaseIE(InfoExtractor):
    _API_BASE = 'https://api.twitter.com/1.1/'
    _BASE_REGEX = r'https?://(?:(?:www|m(?:obile)?)\.)?twitter\.com/'
    _GUEST_TOKEN = None

    def _extract_variant_formats(self, variant, video_id):

            

Reported by Pylint.

youtube_dl/extractor/iqiyi.py
53 issues
Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import re
import time

from .common import InfoExtractor
from ..compat import (
    compat_str,
    compat_urllib_parse_urlencode,
)
from ..utils import (

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              import time

from .common import InfoExtractor
from ..compat import (
    compat_str,
    compat_urllib_parse_urlencode,
)
from ..utils import (
    clean_html,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

                  compat_str,
    compat_urllib_parse_urlencode,
)
from ..utils import (
    clean_html,
    decode_packed_codes,
    get_element_by_id,
    get_element_by_attribute,
    ExtractorError,

            

Reported by Pylint.

Use of insecure MD2, MD4, MD5, or SHA1 hash function.
Security blacklist

Line: 26
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b303-md5

              

def md5_text(text):
    return hashlib.md5(text.encode('utf-8')).hexdigest()


class IqiyiSDK(object):
    def __init__(self, target, ip, timestamp):
        self.target = target

            

Reported by Bandit.

Missing module docstring
Error

Line: 1 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

import hashlib
import itertools
import re
import time

from .common import InfoExtractor

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 25 Column: 1

              )


def md5_text(text):
    return hashlib.md5(text.encode('utf-8')).hexdigest()


class IqiyiSDK(object):
    def __init__(self, target, ip, timestamp):

            

Reported by Pylint.

Missing class docstring
Error

Line: 29 Column: 1

                  return hashlib.md5(text.encode('utf-8')).hexdigest()


class IqiyiSDK(object):
    def __init__(self, target, ip, timestamp):
        self.target = target
        self.ip = ip
        self.timestamp = timestamp


            

Reported by Pylint.

Class 'IqiyiSDK' inherits from object, can be safely removed from bases in python3
Error

Line: 29 Column: 1

                  return hashlib.md5(text.encode('utf-8')).hexdigest()


class IqiyiSDK(object):
    def __init__(self, target, ip, timestamp):
        self.target = target
        self.ip = ip
        self.timestamp = timestamp


            

Reported by Pylint.

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

Line: 32 Column: 9

              class IqiyiSDK(object):
    def __init__(self, target, ip, timestamp):
        self.target = target
        self.ip = ip
        self.timestamp = timestamp

    @staticmethod
    def split_sum(data):
        return compat_str(sum(map(lambda p: int(p, 16), list(data))))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 36 Column: 5

                      self.timestamp = timestamp

    @staticmethod
    def split_sum(data):
        return compat_str(sum(map(lambda p: int(p, 16), list(data))))

    @staticmethod
    def digit_sum(num):
        if isinstance(num, int):

            

Reported by Pylint.

youtube_dl/extractor/ard.py
53 issues
Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              import json
import re

from .common import InfoExtractor
from .generic import GenericIE
from ..utils import (
    determine_ext,
    ExtractorError,
    int_or_none,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              import re

from .common import InfoExtractor
from .generic import GenericIE
from ..utils import (
    determine_ext,
    ExtractorError,
    int_or_none,
    parse_duration,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              
from .common import InfoExtractor
from .generic import GenericIE
from ..utils import (
    determine_ext,
    ExtractorError,
    int_or_none,
    parse_duration,
    qualities,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 23 Column: 1

                  url_or_none,
    xpath_text,
)
from ..compat import compat_etree_fromstring


class ARDMediathekBaseIE(InfoExtractor):
    _GEO_COUNTRIES = ['DE']


            

Reported by Pylint.

Access to a protected member _extract_rss of a client class
Error

Line: 188 Column: 24

                      if re.search(r'[\?&]rss($|[=&])', url):
            doc = compat_etree_fromstring(webpage.encode('utf-8'))
            if doc.tag == 'rss':
                return GenericIE()._extract_rss(url, video_id, doc)

        title = self._og_search_title(webpage, default=None) or self._html_search_regex(
            [r'<h1(?:\s+class="boxTopHeadline")?>(.*?)</h1>',
             r'<meta name="dcterms\.title" content="(.*?)"/>',
             r'<h4 class="headline">(.*?)</h4>',

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # coding: utf-8
from __future__ import unicode_literals

import json
import re

from .common import InfoExtractor
from .generic import GenericIE
from ..utils import (

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 26 Column: 1

              from ..compat import compat_etree_fromstring


class ARDMediathekBaseIE(InfoExtractor):
    _GEO_COUNTRIES = ['DE']

    def _extract_media_info(self, media_info_url, webpage, video_id):
        media_info = self._download_json(
            media_info_url, video_id, 'Downloading media JSON')

            

Reported by Pylint.

Missing class docstring
Error

Line: 26 Column: 1

              from ..compat import compat_etree_fromstring


class ARDMediathekBaseIE(InfoExtractor):
    _GEO_COUNTRIES = ['DE']

    def _extract_media_info(self, media_info_url, webpage, video_id):
        media_info = self._download_json(
            media_info_url, video_id, 'Downloading media JSON')

            

Reported by Pylint.

Unnecessary "elif" after "raise"
Error

Line: 38 Column: 13

                      formats = self._extract_formats(media_info, video_id)

        if not formats:
            if fsk:
                raise ExtractorError(
                    'This video is only available after 20:00', expected=True)
            elif media_info.get('_geoblocked'):
                self.raise_geo_restricted(
                    'This video is not available due to geoblocking',

            

Reported by Pylint.

Too many branches (14/12)
Error

Line: 65 Column: 5

                          'subtitles': subtitles,
        }

    def _extract_formats(self, media_info, video_id):
        type_ = media_info.get('_type')
        media_array = media_info.get('_mediaArray', [])
        formats = []
        for num, media in enumerate(media_array):
            for stream in media.get('_mediaStreamArray', []):

            

Reported by Pylint.