From 094d5a074c950733d7e7cddfd8dadfcbba3b15b6 Mon Sep 17 00:00:00 2001 From: lcjh <120989324@qq.com> Date: Sat, 12 Oct 2024 03:21:23 +0800 Subject: [PATCH] remove imported but unused module --- src/you_get/extractors/acfun.py | 4 ++-- src/you_get/extractors/baidu.py | 4 ++-- src/you_get/extractors/facebook.py | 1 - src/you_get/extractors/fc2video.py | 1 - src/you_get/extractors/giphy.py | 1 - src/you_get/extractors/iqiyi.py | 1 - src/you_get/extractors/ixigua.py | 5 ----- src/you_get/extractors/kuaishou.py | 2 -- src/you_get/extractors/kugou.py | 1 - src/you_get/extractors/pixnet.py | 1 - src/you_get/extractors/sohu.py | 3 --- src/you_get/extractors/soundcloud.py | 1 - src/you_get/extractors/suntv.py | 1 - src/you_get/extractors/ucas.py | 1 - src/you_get/extractors/veoh.py | 1 - src/you_get/extractors/yizhibo.py | 1 - src/you_get/extractors/youku.py | 1 - 17 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/you_get/extractors/acfun.py b/src/you_get/extractors/acfun.py index 5775eb5e74..e9ecad3fdb 100644 --- a/src/you_get/extractors/acfun.py +++ b/src/you_get/extractors/acfun.py @@ -43,7 +43,7 @@ def prepare(self, **kwargs): currentVideoInfo = json_data.get('currentVideoInfo') else: - raise NotImplemented + raise NotImplementedError() if 'ksPlayJson' in currentVideoInfo: durationMillis = currentVideoInfo['durationMillis'] @@ -193,7 +193,7 @@ def getM3u8UrlFromCurrentVideoInfo(currentVideoInfo): m3u8_url = getM3u8UrlFromCurrentVideoInfo(currentVideoInfo) else: - raise NotImplemented + raise NotImplementedError() assert title and m3u8_url title = unescape_html(title) diff --git a/src/you_get/extractors/baidu.py b/src/you_get/extractors/baidu.py index 61b0ad246f..4f64f34def 100644 --- a/src/you_get/extractors/baidu.py +++ b/src/you_get/extractors/baidu.py @@ -185,7 +185,7 @@ def baidu_pan_download(url): isprotected = False sign, timestamp, bdstoken, appid, primary_id, fs_id, uk = baidu_pan_parse( html) - if sign == None: + if sign is None: if re.findall(r'\baccess-code\b', html): isprotected = True sign, timestamp, bdstoken, appid, primary_id, fs_id, uk, fake_headers, psk = baidu_pan_protected_share( @@ -193,7 +193,7 @@ def baidu_pan_download(url): # raise NotImplementedError("Password required!") if isprotected != True: raise AssertionError("Share not found or canceled: %s" % url) - if bdstoken == None: + if bdstoken is None: bdstoken = "" if isprotected != True: sign, timestamp, bdstoken, appid, primary_id, fs_id, uk = baidu_pan_parse( diff --git a/src/you_get/extractors/facebook.py b/src/you_get/extractors/facebook.py index ba8aea8c72..4940390734 100644 --- a/src/you_get/extractors/facebook.py +++ b/src/you_get/extractors/facebook.py @@ -3,7 +3,6 @@ __all__ = ['facebook_download'] from ..common import * -import json def facebook_download(url, output_dir='.', merge=True, info_only=False, **kwargs): url = re.sub(r'//.*?facebook.com','//facebook.com',url) diff --git a/src/you_get/extractors/fc2video.py b/src/you_get/extractors/fc2video.py index d6f522ce61..22efcee404 100644 --- a/src/you_get/extractors/fc2video.py +++ b/src/you_get/extractors/fc2video.py @@ -5,7 +5,6 @@ from ..common import * from hashlib import md5 from urllib.parse import urlparse -import re #---------------------------------------------------------------------- def makeMimi(upid): diff --git a/src/you_get/extractors/giphy.py b/src/you_get/extractors/giphy.py index 1dd30223d2..8bbba0f0bb 100644 --- a/src/you_get/extractors/giphy.py +++ b/src/you_get/extractors/giphy.py @@ -3,7 +3,6 @@ __all__ = ['giphy_download'] from ..common import * -import json def giphy_download(url, output_dir='.', merge=True, info_only=False, **kwargs): html = get_html(url) diff --git a/src/you_get/extractors/iqiyi.py b/src/you_get/extractors/iqiyi.py index 16bf45d3a3..cfd805fefe 100644 --- a/src/you_get/extractors/iqiyi.py +++ b/src/you_get/extractors/iqiyi.py @@ -10,7 +10,6 @@ from random import random,randint import json from math import floor -from zlib import decompress import hashlib import time diff --git a/src/you_get/extractors/ixigua.py b/src/you_get/extractors/ixigua.py index f2fd953e69..a6b3c2d80a 100644 --- a/src/you_get/extractors/ixigua.py +++ b/src/you_get/extractors/ixigua.py @@ -1,12 +1,7 @@ #!/usr/bin/env python import base64 -import binascii - from ..common import * -import random -import string -import ctypes from json import loads from urllib import request diff --git a/src/you_get/extractors/kuaishou.py b/src/you_get/extractors/kuaishou.py index 917920d196..d2ce8709d2 100644 --- a/src/you_get/extractors/kuaishou.py +++ b/src/you_get/extractors/kuaishou.py @@ -2,10 +2,8 @@ import urllib.request import urllib.parse -import json import re -from ..util import log from ..common import get_content, download_urls, print_info, playlist_not_supported, url_size __all__ = ['kuaishou_download_by_url'] diff --git a/src/you_get/extractors/kugou.py b/src/you_get/extractors/kugou.py index 18b342bf7e..1b6df53f1b 100644 --- a/src/you_get/extractors/kugou.py +++ b/src/you_get/extractors/kugou.py @@ -6,7 +6,6 @@ from json import loads from base64 import b64decode import re -import hashlib def kugou_download(url, output_dir=".", merge=True, info_only=False, **kwargs): diff --git a/src/you_get/extractors/pixnet.py b/src/you_get/extractors/pixnet.py index b5c94b2428..85304c0c91 100644 --- a/src/you_get/extractors/pixnet.py +++ b/src/you_get/extractors/pixnet.py @@ -3,7 +3,6 @@ __all__ = ['pixnet_download'] from ..common import * -import urllib.error from time import time from urllib.parse import quote from json import loads diff --git a/src/you_get/extractors/sohu.py b/src/you_get/extractors/sohu.py index e0e4eeb97e..489f0737e7 100644 --- a/src/you_get/extractors/sohu.py +++ b/src/you_get/extractors/sohu.py @@ -5,9 +5,6 @@ from ..common import * import json -import time -from random import random -from urllib.parse import urlparse ''' Changelog: diff --git a/src/you_get/extractors/soundcloud.py b/src/you_get/extractors/soundcloud.py index 08e9d5610e..a0f2d2da47 100644 --- a/src/you_get/extractors/soundcloud.py +++ b/src/you_get/extractors/soundcloud.py @@ -5,7 +5,6 @@ from ..common import * import re import json -import urllib.error def get_sndcd_apikey(): diff --git a/src/you_get/extractors/suntv.py b/src/you_get/extractors/suntv.py index 0b50644038..25d065eccc 100644 --- a/src/you_get/extractors/suntv.py +++ b/src/you_get/extractors/suntv.py @@ -27,7 +27,6 @@ def suntv_download(url, output_dir = '.', merge = True, info_only = False, **kwa html = html.decode('gbk') title = match1(html, '