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

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)
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
Dictionary - Application focused on word search through web scraping

Dictionary - Application focused on word search through web scraping, in addition to other functions such as dictation, spell and conjugation of syllables.

Juan Manuel 2 May 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
Poolbooru gelscraper - a simple python script for scraping images off gelbooru pools.

poolbooru_gelscraper a simple python script for scraping images off gelbooru pools. modules required:requests_html, and os by default saves files with

savantshuia 1 Jan 02, 2022
Docker containerized Python Flask API that uses selenium to scrape and interact with websites

Docker containerized Python Flask API that uses selenium to scrape and interact with websites

Christian Gracia 0 Jan 22, 2022
This Scrapy project uses Redis and Kafka to create a distributed on demand scraping cluster

This Scrapy project uses Redis and Kafka to create a distributed on demand scraping cluster.

IST Research 1.1k Jan 06, 2023
Web-scraping - A bot using Python with BeautifulSoup that scraps IRS website by form number and returns the results as json

Web-scraping - A bot using Python with BeautifulSoup that scraps IRS website (prior form publication) by form number and returns the results as json. It provides the option to download pdfs over a ra

1 Jan 04, 2022
基于Github Action的定时HITsz疫情上报脚本,开箱即用

HITsz Daily Report 基于 GitHub Actions 的「HITsz 疫情系统」访问入口 定时自动上报脚本,开箱即用。 感谢 @JellyBeanXiewh 提供原始脚本和 idea。 感谢 @bugstop 对脚本进行重构并新增 Easy Connect 校内代理访问。

Ter 56 Nov 27, 2022
Ebay Webscraper for Getting Average Product Price

Ebay-Webscraper-for-Getting-Average-Product-Price The code in this repo is used to determine the average price of an item on Ebay given a valid search

17 Jan 05, 2023
Scrapy uses Request and Response objects for crawling web sites.

Requests and Responses¶ Scrapy uses Request and Response objects for crawling web sites. Typically, Request objects are generated in the spiders and p

Md Rashidul Islam 1 Nov 03, 2021
京东茅台抢购 2021年4月最新版

Jd_Seckill 特别声明: 本仓库发布的jd_seckill项目中涉及的任何脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断。 本项目内所有资源文件,禁止任何公众号、自媒体进行任何形式的转载、发布。 huanghyw 对任何脚本问题概不

45 Dec 14, 2022
A spider for Universal Online Judge(UOJ) system, converting problem pages to PDFs.

Universal Online Judge Spider Introduction This is a spider for Universal Online Judge (UOJ) system (https://uoj.ac/). It also works for all other Onl

TriNitroTofu 1 Dec 07, 2021
Console application for downloading images from Reddit in Python

RedditImageScraper Console application for downloading images from Reddit in Python Introduction This short Python script was created for the mass-dow

James 0 Jul 04, 2021
API to parse tibia.com content into python objects.

Tibia.py An API to parse Tibia.com content into object oriented data. No fetching is done by this module, you must provide the html content. Features:

Allan Galarza 25 Oct 31, 2022
download NCERT books using scrapy

download_ncert_books download NCERT books using scrapy Downloading Books: You can either use the spider by cloning this repo and following the instruc

1 Dec 02, 2022
HappyScrapper - Google news web scrapper with python

HappyScrapper ~ Google news web scrapper INSTALLATION ♦ Clone the repository ♦ O

Jhon Aguiar 0 Nov 07, 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
Scrapes the Sun Life of Canada Philippines web site for historical prices of their investment funds and then saves them as CSV files.

slocpi-scraper Sun Life of Canada Philippines Inc Investment Funds Scraper Install dependencies pip install -r requirements.txt Usage General format:

Daryl Yu 2 Jan 07, 2022
Simple python tool for the purpose of swapping latinic letters with cirilic ones and vice versa in txt, docx and pdf files in Serbian language

Alpha Swap English This is a simple python tool for the purpose of swapping latinic letters with cirylic ones and vice versa, in txt, docx and pdf fil

Aleksandar Damnjanovic 3 May 31, 2022
Rottentomatoes, Goodreads and IMDB sites crawler. Semantic Web final project.

Crawler Rottentomatoes, Goodreads and IMDB sites crawler. Crawler written by beautifulsoup, selenium and lxml to gather books and films information an

Faeze Ghorbanpour 1 Dec 30, 2021