腾讯课堂,模拟登陆,获取课程信息,视频下载,视频解密。

Overview

腾讯课堂脚本

要学一些东西,但腾讯课堂不支持自定义变速,播放时有水印,且有些老师的课一遍不够看,于是这个脚本诞生了。

时间比较紧张,只会不定时修复重大bug。多线程下载之类的功能更新短期内不会有,如果你想一起完善这个脚本,欢迎pr

2020.5.22测试可用

使用方法

很简单,三部完成

下载代码, 配置环境为python3 + edge 89
> pip install -r requirements.txt
> python qcourse.py
Tips
  • cid是你登录后url里面的参数,代表course_id
  • 若登录失效,删除cookies.json再重新运行脚本

功能

  • 模拟登录,获取cookies
  • 下载单个视频
  • 按章节下载
  • 下载整个课程
  • 视频下载后自动转换为mp4格式(ffmpeg)
Comments
  • UnboundLocalError: local variable 'uin' referenced before assignment

    UnboundLocalError: local variable 'uin' referenced before assignment

    anaconda python版本3.7.11

    Traceback (most recent call last): File "qcourse.py", line 140, in main() File "qcourse.py", line 134, in main asyncio.run(download_selected_chapter(term_id, course_name, chapter_name, courses, cid)) File "D:\ProgramData\Anaconda3\envs\txkt\lib\asyncio\runners.py", line 43, in run return loop.run_until_complete(main) File "D:\ProgramData\Anaconda3\envs\txkt\lib\asyncio\base_events.py", line 587, in run_until_complete return future.result() File "qcourse.py", line 82, in download_selected_chapter urls = get_download_urls(term_id, file_id, cid=cid) File "D:\down\qcourse_scripts-main\qcourse_scripts-main\utils.py", line 243, in get_download_urls return get_video_url(video_info, video_index, cid=cid, term_id=term_id) File "D:\down\qcourse_scripts-main\qcourse_scripts-main\utils.py", line 222, in get_video_url key_url = get_key_url_from_m3u8(video.get('url')) + '&token=' + get_token_for_key_url(term_id=term_id, cid=cid) File "D:\down\qcourse_scripts-main\qcourse_scripts-main\utils.py", line 212, in get_token_for_key_url .format(uin=uin, skey=skey, pskey=pskey, plskey=plskey, cid=cid, term_id=term_id) UnboundLocalError: local variable 'uin' referenced before assignment

    opened by lsdlh 9
  • NoneType' object has no attribute 'get'

    NoneType' object has no attribute 'get'

    (qcourse-venv) PS D:\qcourse_scripts-main> python qcourse.py 0. 下载单个视频

    1. 下载课程指定章节
    2. 下载课程全部视频

    输入需要的功能:1 请输入课程cid:3138704 Traceback (most recent call last): File "D:\qcourse_scripts-main\qcourse.py", line 140, in main() File "D:\qcourse_scripts-main\qcourse.py", line 105, in main course_name = get_course_from_api(cid) File "D:\qcourse_scripts-main\utils.py", line 20, in get_course_from_api name = response.get('result').get('course_detail').get('name').replace('/', '/').replace('\', '\') AttributeError: 'NoneType' object has no attribute 'get' (qcourse-venv) PS D:\qcourse_scripts-main>

    opened by lenngennd 8
  • 下载报错

    下载报错

    Traceback (most recent call last): File "qcourse.py", line 162, in main() File "qcourse.py", line 152, in main asyncio.run( File "F:\python3.8.5\lib\asyncio\runners.py", line 43, in run return loop.run_until_complete(main) File "F:\python3.8.5\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "qcourse.py", line 92, in download_selected_chapter urls = get_download_urls(term_id, file_id, cid=cid) File "C:\Users\xx\Downloads\qcourse_scripts-main\utils.py", line 281, in get_download_urls return get_video_url(video_info, video_index, cid=cid, term_id=term_id) File "C:\Users\xx\Downloads\qcourse_scripts-main\utils.py", line 253, in get_video_url + get_token_for_key_url(term_id=term_id, cid=cid) File "C:\Users\xx\Downloads\qcourse_scripts-main\utils.py", line 236, in get_token_for_key_url uin=uin, skey=skey, pskey=pskey, plskey=plskey, cid=cid, term_id=term_id UnboundLocalError: local variable 'uin' referenced before assignment

    报这个错误,这是什么原因呀 拉取的最新代码的

    opened by adminlove520 4
  • 2022.4.18 13:20 tx课堂接口 报错

    2022.4.18 13:20 tx课堂接口 报错

    https://ke.qq.com/cgi-bin/course/basic_info?cid= 上面这个接口要带防盗链,不然查询不到参数 错误的返回:{"msg":"refer错误","type":1,"retcode":100101}

    建议解决办法: 在utils.py文件里,的get_course_from_api函数中,添加headers参数 如:
    ''' headers = { 'referer': 'https://ke.qq.com/user/index/index.html', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/80.0.3987.132 Safari/537.36 ' } ''' 即可

    完整函数: ''' python def get_course_from_api(cid=None): headers = { 'referer': 'https://ke.qq.com/user/index/index.html', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/80.0.3987.132 Safari/537.36 ' } # 获取课程信息 if cid is None: print('请输入cid!') url = 'https://ke.qq.com/cgi-bin/course/basic_info?cid=' + str(cid) response = requests.get(url=url, headers=headers).json() name = response.get('result').get('course_detail').get('name').replace('/', '/').replace('\', '\') with open(name + '.json', 'w') as f: f.write(json.dumps(response)) return name '''

    opened by POIB 3
  • check_hostname requires Windows python3.9

    check_hostname requires Windows python3.9

    Traceback (most recent call last): File "D:\study\3\qcourse_scripts\qcourse.py", line 162, in main() File "D:\study\3\qcourse_scripts\qcourse.py", line 118, in main asyncio.run(parse_course_url_and_download(course_url)) File "C:\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "D:\study\3\qcourse_scripts\qcourse.py", line 78, in parse_course_url_and_download urls = get_download_url_from_course_url(video_url, -1) File "D:\study\3\qcourse_scripts\utils.py", line 273, in get_download_url_from_course_url tokens = get_video_token(term_id, file_id) File "D:\study\3\qcourse_scripts\utils.py", line 198, in get_video_token response = requests.get( File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\requests\api.py", line 76, in get return request('get', url, params=params, **kwargs) File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\requests\sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen( File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen self._prepare_proxy(conn) File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy conn.connect() File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\urllib3\connection.py", line 359, in connect conn = self._connect_tls_proxy(hostname, conn) File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\urllib3\connection.py", line 500, in connect_tls_proxy return ssl_wrap_socket( File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\urllib3\util\ssl.py", line 432, in ssl_wrap_socket ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls) File "D:\study\3\qcourse_scripts\qcourse-venv\lib\site-packages\urllib3\util\ssl.py", line 474, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock) File "C:\Python39\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "C:\Python39\lib\ssl.py", line 997, in _create raise ValueError("check_hostname requires server_hostname") ValueError: check_hostname requires server_hostname

    opened by Haoshenqi0123 2
  • AttributeError: 'NoneType' object has no attribute 'get'

    AttributeError: 'NoneType' object has no attribute 'get'

    $ python qcourse.py
    0. 下载单个视频
    1. 下载课程指定章节
    2. 下载课程全部视频
    
    输入需要的功能:2
    请输入课程cid:310478
    Traceback (most recent call last):
      File "D:\Downloads\qcourse_scripts\qcourse.py", line 140, in <module>
        main()
      File "D:\Downloads\qcourse_scripts\qcourse.py", line 121, in main
        course_name = get_course_from_api(cid)
      File "D:\Downloads\qcourse_scripts\utils.py", line 20, in get_course_from_api
        name = response.get('result').get('course_detail').get('name').replace('/', '/').replace('\\', '\')
    AttributeError: 'NoneType' object has no attribute 'get'
    
    opened by stepbystepcode 2
  • 大佬我报错了 请问这是啥原因呀 驱动都安装了

    大佬我报错了 请问这是啥原因呀 驱动都安装了

    Connected to pydev debugger (build 212.5284.44) 0. 下载单个视频

    1. 下载课程指定章节
    2. 下载课程全部视频

    输入需要的功能:python-BaseException Traceback (most recent call last): File "C:\Users\Administrator\PycharmProjects\qcourse_scripts\venv\lib\site-packages\playwright_impl_browser_type.py", line 86, in launch return from_channel(await self._channel.send("launch", params)) File "C:\Users\Administrator\PycharmProjects\qcourse_scripts\venv\lib\site-packages\playwright_impl_connection.py", line 36, in send return await self.inner_send(method, params, False) File "C:\Users\Administrator\PycharmProjects\qcourse_scripts\venv\lib\site-packages\playwright_impl_connection.py", line 54, in inner_send result = next(iter(done)).result() playwright._impl._api_types.Error: Chromium distribution 'msedge' is not found at C:\Users\Administrator\AppData\Local\Microsoft\Edge\Application\msedge.exe Run "npx playwright install msedge"

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "C:\Users\Administrator\PycharmProjects\qcourse_scripts\venv\lib\site-packages\playwright_impl_browser_type.py", line 89, in launch raise not_installed_error(f'"{self.name}" browser was not found.') playwright._impl._api_types.Error:

    "chromium" browser was not found. Please complete Playwright installation via running

    "python -m playwright install"
    

    ================================================================================

    Process finished with exit code 1

    opened by fujiakai 2
  • bug

    bug

    尝试下载整套课程时 1 utils.py49 - 55

    def get_chapters_from_file(filename, term_index):
        # 从json文件内获取章节信息
        with open(filename, 'r') as f:
            course_info = json.loads(f.read())
        chapters = course_info.get('result').get('course_detail').get('terms')[term_index].get('chapter_info')[0]\
            .get('sub_info')
        return chapters
    

    手动修改term_index为目标学期时, 出现下面的错误 2

    opened by ghost 2
  • 求教大佬

    求教大佬

    前面的结果步骤ok,但是到了这一步:playwright install msedge 出现了如下的错误提示:

    无法加载文件 D:\Users\Desktop\qcourse_scripts-main\qcourse-venv\Lib\site-packag es\playwright\driver\package\bin\reinstall_msedge_stable_win.ps1,因为在此系统 中禁止执行脚本。有关详细信息,请参阅 "get-help about_signing"。 所在位置 行:1 字符: 131

    • d:\Users\Desktop\qcourse_scripts-main\qcourse-venv\Lib\site-packages\playwrig ht\driver\package\bin\reinstall_msedge_stable_win.ps1 <<<< https://msedge.sf.d l.delivery.mp.microsoft.com/filestreamingservice/files/2521c007-c376-4e08-8570- 6d8526416a27/MicrosoftEdgeEnterpriseX64.msi
      • CategoryInfo : NotSpecified: (:) [], PSSecurityException
      • FullyQualifiedErrorId : RuntimeException

    Failed to install browsers Error: Failed to install msedge

    如果不理会它,继续进行最后一步:python qcourse.py, 得到这样的日志:

    1. 下载单个视频
    2. 下载课程指定章节
    3. 下载课程全部视频

    输入需要的功能:0 Traceback (most recent call last): File "d:\Users\Desktop\qcourse_scripts-main\qcourse-venv\lib\site-packages\pla ywright_impl_browser_type.py", line 86, in launch return from_channel(await self._channel.send("launch", params)) File "d:\Users\Desktop\qcourse_scripts-main\qcourse-venv\lib\site-packages\pla ywright_impl_connection.py", line 36, in send return await self.inner_send(method, params, False) File "d:\Users\Desktop\qcourse_scripts-main\qcourse-venv\lib\site-packages\pla ywright_impl_connection.py", line 54, in inner_send result = next(iter(done)).result() playwright._impl._api_types.Error: Chromium distribution 'msedge' is not found a t C:\Users\Administrator\AppData\Local\Microsoft\Edge\Application\msedge.exe Run "npx playwright install msedge"

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "qcourse.py", line 137, in main() File "qcourse.py", line 92, in main qq_course = QCourse() File "qcourse.py", line 22, in init self.browser = self.p.chromium.launch(channel='msedge', headless=False) File "d:\Users\Desktop\qcourse_scripts-main\qcourse-venv\lib\site-packages\pla ywright\sync_api_generated.py", line 9703, in launch self._sync( File "d:\Users\Desktop\qcourse_scripts-main\qcourse-venv\lib\site-packages\pla ywright_impl_sync_base.py", line 111, in _sync return task.result() File "d:\Users\Desktop\qcourse_scripts-main\qcourse-venv\lib\site-packages\pla ywright_impl_browser_type.py", line 89, in launch raise not_installed_error(f'"{self.name}" browser was not found.') playwright._impl._api_types.Error:

    "chromium" browser was not found. Please complete Playwright installation via running

    "python -m playwright install"
    

    ================================================================================

    不知道出了什么问题……麻烦大佬给看看,谢谢♪(・ω・)ノ

    opened by BrightMoonInner 2
  • 下载报错TypeError: can only concatenate str (not

    下载报错TypeError: can only concatenate str (not "int") to str

    下载全部课程视频时报错

    请输入要下载的课程序号(回车结束):1
    获取课程信息成功,准备下载!
    Traceback (most recent call last):
      File "qcourse.py", line 154, in <module>
        main()
      File "qcourse.py", line 131, in main
        logger.info('cid: '+cid)
    TypeError: can only concatenate str (not "int") to str
    
    opened by sunjinkkk 1
  • 安装报错

    安装报错

    qcourse-venv) F:\tx\qcourse_scripts-main>playwright install msedge Failed to install browsers Error: ╔═════════════════════════════════════════════════════════════════╗ ║ ATTENTION: "msedge" is already installed on the system! ║ ║ ║ ║ "msedge" installation is not hermetic; installing newer version ║ ║ requires removal of a current installation first. ║ ║ ║ ║ To uninstall current version and re-install latest "msedge": ║ ║ ║ ║ - Close all running instances of "msedge", if any ║ ║ - Use "--force" to install browser: ║ ║ ║ ║ playwright install --force msedge ║ ║ ║ ║ <3 Playwright Team ║ ╚═════════════════════════════════════════════════════════════════╝

    opened by hackpwnpwn 1
  • 使用下载课程指定章节和下载课程全部视频出现异常

    使用下载课程指定章节和下载课程全部视频出现异常

    image image 使用过程中会出现这个 因为课程内容大小不一样 重复这个过程最多能够下载完成3个视频 但是剩下的就怎么都下载不完了 有的章节10来个视频呢

    如果使用下载课程全部视频 会继续上面的那个错误跳到下个章节序列继续下载 但是也是下载不全 不知道怎么解决

    def run_shell(shell, retry=True, retry_times=3): cmd = subprocess.Popen( shell, close_fds=True, shell=True, bufsize=1, stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL, )

    if retry and cmd.returncode != 0:
        time.sleep(1)
        if retry_times > 0:
            return run_shell(shell, retry=True, retry_times=retry_times - 1)
        print('\nShell出现异常,请自行查看课程文件是否转码成功')
    return cmd.returncode
    

    我感觉是不是这个地方有问题造成的 是不是def run_shell(shell, retry=True, retry_times=3): 这个retry_times=3 值修改大一点?

    opened by 0ming0 0
  • 是不是不能下载购买了的视频

    是不是不能下载购买了的视频

    #55 问题已经解决了。

    然后,发现收费的视频无法下载,log里面报错: Incorrect AES key length (39 bytes)

    完整日志:

    2022-11-28 20:07:31,902 - INFO - cid: 453949 2022-11-28 20:07:41,608 - ERROR - Task exception was never retrieved future: <Task finished name='Task-9' coro=<download_single() done, defined at D:\qcourse_scripts-main\downloader.py:138> exception=ValueError('Incorrect AES key length (39 bytes)')> Traceback (most recent call last): File "D:\qcourse_scripts-main\downloader.py", line 150, in download_single decrypt_file(str(file) + '.ts', key) File "D:\qcourse_scripts-main\downloader.py", line 28, in decrypt_file dec = decrypt(ciphertext, key) ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\downloader.py", line 20, in decrypt cipher = AES.new(key, AES.MODE_CBC, iv) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\AES.py", line 232, in new return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\__init__.py", line 79, in _create_cipher return modes[mode](factory, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher cipher_state = factory._create_base_cipher(kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\AES.py", line 93, in _create_base_cipher raise ValueError("Incorrect AES key length (%d bytes)" % len(key)) ValueError: Incorrect AES key length (39 bytes) 2022-11-28 20:07:45,755 - ERROR - Task exception was never retrieved future: <Task finished name='Task-17' coro=<download_single() done, defined at D:\qcourse_scripts-main\downloader.py:138> exception=ValueError('Incorrect AES key length (39 bytes)')> Traceback (most recent call last): File "D:\qcourse_scripts-main\downloader.py", line 150, in download_single decrypt_file(str(file) + '.ts', key) File "D:\qcourse_scripts-main\downloader.py", line 28, in decrypt_file dec = decrypt(ciphertext, key) ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\downloader.py", line 20, in decrypt cipher = AES.new(key, AES.MODE_CBC, iv) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\AES.py", line 232, in new return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\__init__.py", line 79, in _create_cipher return modes[mode](factory, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher cipher_state = factory._create_base_cipher(kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\AES.py", line 93, in _create_base_cipher raise ValueError("Incorrect AES key length (%d bytes)" % len(key)) ValueError: Incorrect AES key length (39 bytes) 2022-11-28 20:07:45,757 - ERROR - Task exception was never retrieved future: <Task finished name='Task-18' coro=<download_single() done, defined at D:\qcourse_scripts-main\downloader.py:138> exception=ValueError('Incorrect AES key length (39 bytes)')> Traceback (most recent call last): File "D:\qcourse_scripts-main\downloader.py", line 150, in download_single decrypt_file(str(file) + '.ts', key) File "D:\qcourse_scripts-main\downloader.py", line 28, in decrypt_file dec = decrypt(ciphertext, key) ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\downloader.py", line 20, in decrypt cipher = AES.new(key, AES.MODE_CBC, iv) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\AES.py", line 232, in new return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\__init__.py", line 79, in _create_cipher return modes[mode](factory, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher cipher_state = factory._create_base_cipher(kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\AES.py", line 93, in _create_base_cipher raise ValueError("Incorrect AES key length (%d bytes)" % len(key)) ValueError: Incorrect AES key length (39 bytes) 2022-11-28 20:07:45,757 - ERROR - Task exception was never retrieved future: <Task finished name='Task-19' coro=<download_single() done, defined at D:\qcourse_scripts-main\downloader.py:138> exception=ValueError('Incorrect AES key length (39 bytes)')> Traceback (most recent call last): File "D:\qcourse_scripts-main\downloader.py", line 150, in download_single

    所以请问是不是不能下载收费的视频,因为我试了一下免费的视频是可以下载的。

    opened by oper1000 2
  • 下载失效了

    下载失效了

    即将开始下载章节:项目的介绍与配置

    Traceback (most recent call last): File "qcourse.py", line 154, in main() File "qcourse.py", line 123, in main asyncio.run( File "D:\software\anaconda3\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "D:\software\anaconda3\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "qcourse.py", line 80, in download_selected_chapter urls = get_download_urls(term_id, file_id, cid=cid) File "D:\workspace\腾讯课堂下载器\qcourse_scripts\utils.py", line 345, in get_download_urls video_info = get_video_info( File "D:\workspace\腾讯课堂下载器\qcourse_scripts\utils.py", line 258, in get_video_info response = requests.get(url, params=params, cookies=load_json_cookies(), proxies=PROXIES).json() File "D:\workspace\腾讯课堂下载器\qcourse_scripts\qcourse-venv\lib\site-packages\requests\models.py", line 900, in json return complexjson.loads(self.text, **kwargs) File "D:\software\anaconda3\lib\json_init_.py", line 357, in loads return _default_decoder.decode(s) File "D:\software\anaconda3\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "D:\software\anaconda3\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    opened by lemonguess 0
  • Incorrect AES key length (39 bytes)

    Incorrect AES key length (39 bytes)

    [■■■■■■■■■■■■■■■■■■■■■■■■■■■ ] 91%Traceback (most recent call last): File "qcourse.py", line 154, in <module> main() File "qcourse.py", line 106, in main asyncio.run(parse_course_url_and_download(course_url)) File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "qcourse.py", line 68, in parse_course_url_and_download await download_single(urls[0], urls[1], filename, path) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\downloader.py", line 150, in download_single decrypt_file(str(file) + '.ts', key) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\downloader.py", line 28, in decrypt_file dec = decrypt(ciphertext, key) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\downloader.py", line 20, in decrypt cipher = AES.new(key, AES.MODE_CBC, iv) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\qcourse-venv\lib\site-packages\Crypto\Cipher\AES.py", line 232, in new return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\qcourse-venv\lib\site-packages\Crypto\Cipher\__init__.py", line 79, in _create_cipher return modes[mode](factory, **kwargs) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\qcourse-venv\lib\site-packages\Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher cipher_state = factory._create_base_cipher(kwargs) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\qcourse-venv\lib\site-packages\Crypto\Cipher\AES.py", line 93, in _create_base_cipher raise ValueError("Incorrect AES key length (%d bytes)" % len(key)) ValueError: Incorrect AES key length (39 bytes)

    opened by codercplus 2
Releases(v1.0)
A web scraper that exports your entire WhatsApp chat history.

WhatSoup 🍲 A web scraper that exports your entire WhatsApp chat history. Table of Contents Overview Demo Prerequisites Instructions Frequen

Eddy Harrington 87 Jan 06, 2023
An helper library to scrape data from TikTok in one line, using the Influencer Hunters APIs.

TikTok Scraper An utility library to scrape data from TikTok hassle-free Go to the website » View Demo · Report Bug · Request Feature About The Projec

6 Jan 08, 2023
茅台抢购最新优化版本,茅台秒杀,优化了抢购协程队列

茅台抢购最新优化版本,茅台秒杀,优化了抢购协程队列

MaoTai 33 Sep 03, 2022
A module for CME that spiders hashes across the domain with a given hash.

hash_spider A module for CME that spiders hashes across the domain with a given hash. Installation Simply copy hash_spider.py to your CME module folde

37 Sep 08, 2022
Danbooru scraper with python

Danbooru Version: 0.0.1 License under: MIT License Dependencies Python: = 3.9.7 beautifulsoup4 cloudscraper Example of use Danbooru from danbooru imp

Sugarbell 2 Oct 27, 2022
Demonstration on how to use async python to control multiple playwright browsers for web-scraping

Playwright Browser Pool This example illustrates how it's possible to use a pool of browsers to retrieve page urls in a single asynchronous process. i

Bernardas Ališauskas 8 Oct 27, 2022
A Pixiv web crawler module

Pixiv-spider A Pixiv spider module WARNING It's an unfinished work, browsing the code carefully before using it. Features 0004 - Readme.md updated, co

Uzuki 1 Nov 14, 2021
Scraping weather data using Python to receive umbrella reminders

A Python package which scrapes weather data from google and sends umbrella reminders to specified email at specified time daily.

Edula Vinay Kumar Reddy 1 Aug 23, 2022
Audio media crawler for lbry.

Audio media crawler for lbry. Requirements Python 3.8 Poetry 1.1.7 Elasticsearch 7.14.0 Lbry-sdk 0.99.0 Development This project uses poetry as a depe

Hound.fm 4 Dec 03, 2022
Goblyn is a Python tool focused to enumeration and capture of website files metadata.

Goblyn Metadata Enumeration What's Goblyn? Goblyn is a tool focused to enumeration and capture of website files metadata. How it works? Goblyn will se

Gustavo 46 Nov 22, 2022
Minimal set of tools to conduct stealthy scraping.

Stealthy Scraping Tools Do not use puppeteer and playwright for scraping. Explanation. We only use the CDP to obtain the page source and to get the ab

Nikolai Tschacher 88 Jan 04, 2023
Get paper names from dblp.org

scraper-dblp Get paper names from dblp.org and store them in a .txt file Useful for a related literature :) Install libraries pip3 install -r requirem

Daisy Lab 1 Dec 07, 2021
A Python Covid-19 cases tracker that scrapes data off the web and presents the number of Cases, Recovered Cases, and Deaths that occurred because of the pandemic.

A Python Covid-19 cases tracker that scrapes data off the web and presents the number of Cases, Recovered Cases, and Deaths that occurred because of the pandemic.

Alex Papadopoulos 1 Nov 13, 2021
Dailyiptvlist.com Scraper With Python

Dailyiptvlist.com scraper Info Made in python Linux only script Script requires to have wget installed Running script Clone repository with: git clone

1 Oct 16, 2021
原神爬虫 抓取原神界面圣遗物信息

原神圣遗物半自动爬虫 说明 直接抓取原神界面中的圣遗物数据 目前只适配了背包页面的抓取 准确率:97.5%(普通通用接口,对 40 件随机圣遗物识别,统计完全正确的数量为 39) 准确率:100%(4k 屏幕,普通通用接口,对 110 件圣遗物识别,统计完全正确的数量为 110) 不排除还有小错误的

hwa 28 Oct 10, 2022
A powerful annex BUBT, BUBT Soft, and BUBT website scraping script.

Annex Bubt Scraping Script I think this is the first public repository that provides free annex-BUBT, BUBT-Soft, and BUBT website scraping API script

Md Imam Hossain 4 Dec 03, 2022
Consulta de CPF e CNPJ na Receita Federal com Web-Scraping

Repositório contendo scripts Python que realizam a consulta de CPF e CNPJ diretamente no site da Receita Federal.

Josué Campos 5 Nov 29, 2021
Kusonime scraper using python3

Features Scrap from url Scrap from recommendation Search by query Todo [+] Search by genre Example # Get download url from kusonime import Scrap

MhankBarBar 2 Jan 28, 2022
This is python to scrape overview and reviews of companies from Glassdoor.

Data Scraping for Glassdoor This is python to scrape overview and reviews of companies from Glassdoor. Please use it carefully and follow the Terms of

Houping 5 Jun 23, 2022
A web scraping pipeline project that retrieves TV and movie data from two sources, then transforms and stores data in a MySQL database.

New to Streaming Scraper An in-progress web scraping project built with Python, R, and SQL. The scraped data are movie and TV show information. The go

Charles Dungy 1 Mar 28, 2022