Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Subtitles are not downloaded in the latest branch #231

Open
Lollinoo opened this issue Jul 16, 2024 · 5 comments
Open

[Bug]: Subtitles are not downloaded in the latest branch #231

Lollinoo opened this issue Jul 16, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Lollinoo
Copy link

What happened?

I tried downloading the same course using the last two versions of the master branch (Before/After refactor branch) and noticed that subtitles are not downloaded in the last update.

Expected Result

Command used: python .\main.py -c CourseURL -b cookie.txt --download-captions --skip-lectures --log-level DEBUG

BEFORE UPDATE:

[12:23:24] [udemy-downloader] [parse_new:1786] INFO: Processing 15 caption(s)...
[12:23:24] [udemy-downloader] [process_caption:1566] INFO: > Downloading caption: '001 Introduction_en.vtt'

07/17 00:23:24 [NOTICE] Downloading 1 item(s)

07/17 00:23:24 [NOTICE] Download complete: C:/Users/User/Desktop/udemy-downloader-master-old/out_dir/ccna-complete/01 - Welcome/001 Introduction_en.vtt

Download Results:
gid |stat|avg speed |path/URI
======+====+===========+=======================================================
e6815a|OK | 426KiB/s|C:/Users/User/Desktop/udemy-downloader-master-old/out_dir/ccna-complete/01 - Welcome/001 Introduction_en.vtt

Status Legend:
(OK):download completed.
[12:23:24] [udemy-downloader] [process_caption:1569] DEBUG: > Download return code: 0
[12:23:24] [udemy-downloader] [process_caption:1579] INFO: > Converting caption to SRT format...
[12:23:24] [udemy-downloader] [process_caption:1581] INFO: > Caption conversion complete.


AFTER UPDATE:

[12:38:57] [udemy-downloader] [parse_new:1658] INFO: ======= Processing chapter 1 of 320=======
[12:39:00] [udemy-downloader] [parse_new:1710] INFO: Processing 0 caption(s)...
[12:39:04] [udemy-downloader] [parse_new:1710] INFO: Processing 0 caption(s)...
[12:39:04] [udemy-downloader] [parse_new:1710] INFO: Processing 0 caption(s)...
[12:39:05] [udemy-downloader] [parse_new:1710] INFO: Processing 0 caption(s)...
[12:39:08] [udemy-downloader] [parse_new:1710] INFO: Processing 0 caption(s)...

Branch

master/main

What operating systems are you seeing the problem on?

Windows

Relevant log output

No response

Other information

No response

@Lollinoo Lollinoo added the bug Something isn't working label Jul 16, 2024
@Puyodead1
Copy link
Owner

Puyodead1 commented Jul 17, 2024

this is intentional, there was an issue where trying to get subtitles from the udemy API caused udemy to return http errors. I haven't checked if udemy fixed it, but you can try it by changing COURSE_URL in constants.py to
COURSE_URL = "https://{portal_name}.udemy.com/api-2.0/courses/{course_id}/subscriber-curriculum-items/?page_size=100&fields[asset]=asset_type,length,captions,media_license_token,course_is_drmed,media_sources,thumbnail_sprite,slides,slide_urls,filename,download_urls,external_url,stream_urls&fields[chapter]=object_index,title&fields[lecture]=id,title,object_index,asset,supplementary_assets,view_html&caching_intent=True"

@Lollinoo
Copy link
Author

Lollinoo commented Jul 17, 2024

upstream connect error or disconnect/reset before headers. reset reason: connection termination

One workaround I am trying to work on is storing the “LectureIDs” and placing them within this new url:

LECTURE_URL =https://{portal_name}.udemy.com/api-2.0/users/me/subscribed-courses/{course_id}/lectures/{lecture_id}/?fields[lecture]=asset,description,download_url&fields[asset]=asset_type,length,media_license_token,course_is_drmed,media_sources,captions,thumbnail_sprite,slides,slide_urls,download_urls,external_url

Only from this api you can get the url of the subtitles, but this will greatly complicate the flow of the program

@Puyodead1
Copy link
Owner

upstream connect error or disconnect/reset before headers. reset reason: connection termination

One workaround I am trying to work on is storing the “LectureIDs” and placing them within this new url:

LECTURE_URL =https://{portal_name}.udemy.com/api-2.0/users/me/subscribed-courses/{course_id}/lectures/{lecture_id}/?fields[lecture]=asset,description,download_url&fields[asset]=asset_type,length,media_license_token,course_is_drmed,media_sources,captions,thumbnail_sprite,slides,slide_urls,download_urls,external_url

Only from this api you can get the url of the subtitles, but this will greatly complicate the flow of the program

That's just not feasible

@Muhammed-Osamaa
Copy link

i have the same issue

Repository owner locked and limited conversation to collaborators Aug 8, 2024
@Puyodead1 Puyodead1 pinned this issue Aug 27, 2024
Repository owner unlocked this conversation Aug 29, 2024
@Puyodead1
Copy link
Owner

This issue may be fixed in 2d6a302, they seem to be downloading fine for me in a course with 182 lectures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants