Puyodead1 / udemy-downloader

A Udemy downloader that can download courses, with DRM support.
MIT License
1.26k stars 291 forks source link

[Bug]: Most of the courses can be downloaded, but some courses exist in the form of .mp4.part.frag.urls. #196

Closed hughware closed 8 months ago

hughware commented 8 months ago

What happened?

run : python main.py -c https://www.udemy.com/course/the-python-mega-course

Expected Result

All courses should be downloaded in full at once

Branch

master/main

What operating systems are you seeing the problem on?

Windows

Relevant log output

it happens a lot
12/18 01:17:57 [ERROR] CUID#9 - Download aborted. URI=https://hls-c.udemycdn.com/2022-10-28_22-18-34-ac233a337f604226892da105e073b0e3/2/hls/AVC_19
20x1080_800k_AAC-HE_64k/aa00182adb4b6229297b3507448410e79a8b2.ts?Expires=1702849667&Signature=PDesknOOPzpzkBTgw14Om4b0QEr4Ewcu36Y91eZbkl03ogqi9ItZ
cafcfXvOlK~AQ4wvfd3fjQPicsZ2hMB0nLIFFJ1OSZ1zVrkcnvilSDWHYp1DB0A~dVklxHSgVY2VRky6xlvBa8b6yx5qy7BEqpOWukVDQ2psJtbtyNgSQpIvLZnDkWuqoK7ljKQU-vRZlRvRS8
qC0a80PKAgu9ETUAleTvKxgDNzICtbjtDClKTze5Mvxq3Kz7PizbcAQbAo49DRQC1KPCUTHbz2Y5KlRh~pV1yEijeD8AzUud~7mh2xePZHeVOZ8OHL70RwqyRbH~WEDdRxxTsLipfqzBgVNw__&Key-Pair-Id=K3MG148K9RIRF4
Exception: [AbstractCommand.cc:312] errorCode=1 Network problem has occurred. cause:An attempt was made to access a socket in a way forbidden by its access permissions.

--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
    stream.write(msg + self.terminator)
UnicodeEncodeError: 'gbk' codec can't encode character '\u25b6' in position 74: illegal multibyte sequence
Call stack:

Other information

图片 图片

I've run it 6 times and it's still not downloading.

hughware commented 8 months ago

After I ran it repeatedly for a night, it seemed to have good results. But there are still some courses that have not been downloaded. Here is my detection code

import os
directory = r"E:\out_dir\the-python-mega-course"
for root, dirs, files in os.walk(directory):
    for file in files:
        ext = os.path.splitext(file)[1]
        if ext == ".urls":
            file_path = os.path.join(root, file)
            print(file_path)

Looking at the results I'll only have two courses that didn't download successfully

E:\out_dir\the-python-mega-course\30 - Day 27 - App 5 Build a Daily News Digest with Python (Part 1)\001 ▶️  Today.mp4.part.frag.urls
E:\out_dir\the-python-mega-course\53 - Day 46 - App 13 Build an SQLite Student Management System with PyQt (Part 2)\006 ✎  Student Project - Implement the Search Functionality.mp4.part.frag.urls

So what command should I use to download these two courses separately?

parvinders347 commented 8 months ago

After I ran it repeatedly for a night, it seemed to have good results. But there are still some courses that have not been downloaded. Here is my detection code

import os
directory = r"E:\out_dir\the-python-mega-course"
for root, dirs, files in os.walk(directory):
    for file in files:
        ext = os.path.splitext(file)[1]
        if ext == ".urls":
            file_path = os.path.join(root, file)
            print(file_path)

Looking at the results I'll only have two courses that didn't download successfully

E:\out_dir\the-python-mega-course\30 - Day 27 - App 5 Build a Daily News Digest with Python (Part 1)\001 ▶️  Today.mp4.part.frag.urls
E:\out_dir\the-python-mega-course\53 - Day 46 - App 13 Build an SQLite Student Management System with PyQt (Part 2)\006 ✎  Student Project - Implement the Search Functionality.mp4.part.frag.urls

So what command should I use to download these two courses separately?

you solved the issue? its giving me same error

Puyodead1 commented 8 months ago

After I ran it repeatedly for a night, it seemed to have good results. But there are still some courses that have not been downloaded. Here is my detection code

import os
directory = r"E:\out_dir\the-python-mega-course"
for root, dirs, files in os.walk(directory):
    for file in files:
        ext = os.path.splitext(file)[1]
        if ext == ".urls":
            file_path = os.path.join(root, file)
            print(file_path)

Looking at the results I'll only have two courses that didn't download successfully

E:\out_dir\the-python-mega-course\30 - Day 27 - App 5 Build a Daily News Digest with Python (Part 1)\001 ▶️  Today.mp4.part.frag.urls
E:\out_dir\the-python-mega-course\53 - Day 46 - App 13 Build an SQLite Student Management System with PyQt (Part 2)\006 ✎  Student Project - Implement the Search Functionality.mp4.part.frag.urls

So what command should I use to download these two courses separately?

use feat/refactor