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

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 simple code to fetch comments below an Instagram post and save them to a csv file

fetch_comments A simple code to fetch comments below an Instagram post and save them to a csv file usage First you have to enter your username and pas

2 Jul 14, 2022
An automated, headless YouTube Watcher and Scraper

Searches YouTube, queries recommended videos and watches them. All fully automated and anonymised through the Tor network. The project consists of two independently usable components, the YouTube aut

44 Oct 18, 2022
A universal package of scraper scripts for humans

Scrapera is a completely Chromedriver free package that provides access to a variety of scraper scripts for most commonly used machine learning and data science domains.

299 Dec 15, 2022
Find thumbnails and original images from URL or HTML file.

Haul Find thumbnails and original images from URL or HTML file. Demo Hauler on Heroku Installation on Ubuntu $ sudo apt-get install build-essential py

Vinta Chen 150 Oct 15, 2022
Explore scraping with BeautifulSoup!

beautifulsoup-scrape Explore scraping with BeautifulSoup! Part One: Start from Shakespeare As my professor is a poet (yes, and he teaches me data and

Chuqin 2 Oct 05, 2022
Pelican plugin that adds site search capability

Search: A Plugin for Pelican This plugin generates an index for searching content on a Pelican-powered site. Why would you want this? Static sites are

22 Nov 21, 2022
Python scrapper scrapping torrent website and download new movies Automatically.

torrent-scrapper Python scrapper scrapping torrent website and download new movies Automatically. If you like it Put a ⭐ on this repo 😇 Run this git

Fazil vk 1 Jan 08, 2022
feapder 是一款简单、快速、轻量级的爬虫框架。以开发快速、抓取快速、使用简单、功能强大为宗旨。支持分布式爬虫、批次爬虫、多模板爬虫,以及完善的爬虫报警机制。

feapder 是一款简单、快速、轻量级的爬虫框架。起名源于 fast、easy、air、pro、spider的缩写,以开发快速、抓取快速、使用简单、功能强大为宗旨,历时4年倾心打造。支持轻量爬虫、分布式爬虫、批次爬虫、爬虫集成,以及完善的爬虫报警机制。 之

boris 1.4k Dec 29, 2022
Binance Smart Chain Contract Scraper + Contract Evaluator

Pulls Binance Smart Chain feed of newly-verified contracts every 30 seconds, then checks their contract code for links to socials.Returns only those with socials information included, and then submit

14 Dec 09, 2022
Crawler in Python 3.7, 3.8. 3.9. Pypy3

Description Python Crawler written Python 3. (Supports major Python releases Python3.6, Python3.7 and Python 3.8) Installation and Use Setup VirtualEn

Vinit Kumar 2 Mar 12, 2022
Google Scholar Web Scraping

Google Scholar Web Scraping This is a python script that asks for a user to input the url for a google scholar profile, and then it writes publication

Suzan M 1 Dec 12, 2021
PS5 bot to find a console in france for chrismas 🎄🎅🏻 NOT FOR SCALPERS

Une PS5 pour Noël Python + Chrome --headless = une PS5 pour noël MacOS Installer chrome Tweaker le .yaml pour la listes sites a scrap et les criteres

Olivier Giniaux 3 Feb 13, 2022
Google Maps crawler using Selenium

Google Maps Crawler using Selenium Built as part of the Antifragile Dev Project Selenium crawler that browses Google Maps as a regular user and stores

Guilherme Latrova 46 Dec 16, 2022
A dead simple crawler to get books information from Douban.

Introduction A dead simple crawler to get books information from Douban. Pre-requesites Python 3 Install dependencies from requirements.txt (Optional)

Yun Wang 1 Jan 10, 2022
A Scrapper with python

Scrapper-en-python Scrapper des données signifie récuperer des données pour les traiter ou les analyser. En python, il y'a 2 grands moyens de scrapper

Lun4rIum 1 Dec 05, 2021
Telegram Group Scrapper

this programe is make your work so much easy on telegrame. do you want to send messages on everyone to your group or others group. use this script it will do your work automatically with one click. a

HackArrOw 3 Dec 03, 2022
优化版本的京东茅台抢购神器

优化版本的京东茅台抢购神器

1.8k Mar 18, 2022
A Powerful Spider(Web Crawler) System in Python.

pyspider A Powerful Spider(Web Crawler) System in Python. Write script in Python Powerful WebUI with script editor, task monitor, project manager and

Roy Binux 15.7k Jan 04, 2023
Create crawler get some new products with maximum discount in banimode website

crawler-banimode create crawler and get some new products with maximum discount in banimode website. این پروژه کوچک جهت یادگیری و کار با ابزار سلنیوم

nourollah rezaei 2 Feb 17, 2022
Async Python 3.6+ web scraping micro-framework based on asyncio

Ruia 🕸️ Async Python 3.6+ web scraping micro-framework based on asyncio. ⚡ Write less, run faster. Overview Ruia is an async web scraping micro-frame

howie.hu 1.6k Jan 01, 2023