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

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)
UdemyBot - A Simple Udemy Free Courses Scrapper

UdemyBot - A Simple Udemy Free Courses Scrapper

Gautam Kumar 112 Nov 12, 2022
Minecraft Item Scraper

Minecraft Item Scraper To run, first ensure you have the BeautifulSoup module: pip install bs4 Then run, python minecraft_items.py folder-to-save-ima

Jaedan Calder 1 Dec 29, 2021
京东茅台抢购

截止 2021/2/1 日,该项目已无法使用! 京东:约满即止,仅限京东实名认证用户APP端抢购,2月1日10:00开始预约,2月1日12:00开始抢购(京东APP需升级至8.5.6版本及以上) 写在前面 本项目来自 huanghyw - jd_seckill,作者的项目地址我找不到了,找到了再贴上

abee 73 Dec 03, 2022
Divar.ir Ads scrapper

Divar.ir Ads Scrapper Introduction This project first asynchronously grab Divar.ir Ads and then save to .csv and .xlsx files named data.csv and data.x

Iman Kermani 4 Aug 29, 2022
A python tool to scrape NFT's off of OpenSea

Right Click Bot A script to download NFT PNG's from OpenSea. All the NFT's you could ever want, no blockchain, for free. Usage Must Use Python 3! Auto

15 Jul 16, 2022
jd_maotai rpa 基于selenium驱动的jd抢购rpa机器人

jd_maotai rpa 基于selenium驱动的jd抢购rpa机器人, 照顾我们这样的马大哈, 不会忘记抢购了, 祝大家过年都能喝上茅台. 特别声明: 本仓库发布的jd_maotai_rpa项目定义为自动化rpa项目, 是用于防止忘记参与jd茅台的活动(由于本人时常忘记), 而不是为了秒杀和抢

35 Nov 18, 2022
Tool to scan for secret files on HTTP servers

snallygaster Finds file leaks and other security problems on HTTP servers. what? snallygaster is a tool that looks for files accessible on web servers

Hanno Böck 2k Dec 28, 2022
This is a webscraper for a specific website

This is a webscraper for a specific website. It is tuned to extract the headlines of that website. With some little adjustments the webscraper is able to extract any part of the website.

Rahul Siyanwal 1 Dec 13, 2021
PyQuery-based scraping micro-framework.

demiurge PyQuery-based scraping micro-framework. Supports Python 2.x and 3.x. Documentation: http://demiurge.readthedocs.org Installing demiurge $ pip

Matias Bordese 109 Jul 20, 2022
Scraping web pages to get data

Scraping Data Get public data and save in database This is project use Python How to run a project 1 - Clone the repository 2 - Install beautifulsoup4

Soccer Project 2 Nov 01, 2021
京东云无线宝积分推送,支持查看多设备积分使用情况

JDRouterPush 项目简介 本项目调用京东云无线宝API,可每天定时推送积分收益情况,帮助你更好的观察主要信息 更新日志 2021-03-02: 查询绑定的京东账户 通知排版优化 脚本检测更新 支持Server酱Turbo版 2021-02-25: 实现多设备查询 查询今

雷疯 199 Dec 12, 2022
python+selenium实现的web端自动打卡 + 每日邮件发送 + 金山词霸 每日一句 + 毒鸡汤(从2月份稳定运行至今)

python+selenium实现的web端自动打卡 说明 本打卡脚本适用于郑州大学健康打卡,其他web端打卡也可借鉴学习。(自己用的,从2月分稳定运行至今) 仅供学习交流使用,请勿依赖。开发者对使用本脚本造成的问题不负任何责任,不对脚本执行效果做出任何担保,原则上不提供任何形式的技术支持。 为防止

Sunday 1 Aug 27, 2022
Screen scraping and web crawling framework

Pomp Pomp is a screen scraping and web crawling framework. Pomp is inspired by and similar to Scrapy, but has a simpler implementation that lacks the

Evgeniy Tatarkin 61 Jun 21, 2021
Script used to download data for stocks.

This script is useful for downloading stock market data for a wide range of companies specified by their respective tickers. The script reads in the d

Carmelo Gonzales 71 Oct 04, 2022
This tool crawls a list of websites and download all PDF and office documents

This tool crawls a list of websites and download all PDF and office documents. Then it analyses the PDF documents and tries to detect accessibility issues.

AccessibilityLU 7 Sep 30, 2022
Web Scraping Framework

Grab Framework Documentation Installation $ pip install -U grab See details about installing Grab on different platforms here http://docs.grablib.

2.3k Jan 04, 2023
京东茅台抢购最新优化版本,京东茅台秒杀,优化了茅台抢购进程队列

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

MaoTai 129 Dec 14, 2022
京东秒杀商品抢购Python脚本

Jd_Seckill 非常感谢原作者 https://github.com/zhou-xiaojun/jd_mask 提供的代码 也非常感谢 https://github.com/wlwwu/jd_maotai 进行的优化 主要功能 登陆京东商城(www.jd.com) cookies登录 (需要自

Andy Zou 1.5k Jan 03, 2023
Haphazard scripts for scraping bitcoin/bitcoin data from GitHub

This is a quick-and-dirty tool used to scrape bitcoin/bitcoin pull request and commentary data. Each output/pr number folder contains comments.json:

James O'Beirne 8 Oct 12, 2022
An experiment to deploy a serverless infrastructure for a scrapy project.

Serverless Scrapy project This project aims to evaluate the feasibility of an architecture based on serverless technology for a web crawler using scra

José Ferraz Neto 5 Jul 08, 2022