r0oth3x49 / udemy-dl

A cross-platform python based utility to download courses from udemy for personal offline use.
MIT License
4.86k stars 1.2k forks source link

Not downloading #431

Closed badjano closed 5 years ago

badjano commented 5 years ago

Describe the bug logs in successfully but after loading course info I get this for all videos and no download happens: [] : Downloading (021 Conclusion) [] : Lecture : '021 Conclusion' (download skipped). [-] : Reason : enter

To Reproduce python3 udemy-dl.py https://www.udemy.com/course/creating-a-node-based-editor-in-unity-3d/

Expected behavior It should download the videos, when I try with --save argument, the txt file gets the correct link for the video, I should be able to make a script to download them all with the txt file, but it annoys me having to do that when this should be working

Screenshots image

Python Environment (please complete the following information): macos high sierra Python 3.7.3

Additional context Thanks for doing this... when I get home I'll try on my pc to see if it works

badjano commented 5 years ago

I just tried with cookies, didn't work either

badjano commented 5 years ago

In case someone else is having this problem, this should work to save the videos from the txt file

import urllib.request

with open("course_name.txt") as f:
    count = 0
    for file in f.readlines():
        url = file.replace("\n", "")
        print(url)
        if ".mp4" in url:
            urllib.request.urlretrieve(url, 'video_%d.mp4' % count)
            count += 1
badjano commented 5 years ago

Also, it would be nice to have a json output for the --save argument so we can have details from the file like chapter/lesson and other stuff

badjano commented 5 years ago

didn´t work on my pc either Windows 10 python 3.7.2

badjano commented 5 years ago

I decided to debug it and found this error on the requests.get result, it was returning AttributeError with enter on the message, so I found this issue and installed requests==2.22.0 and it fixed the problem.

you should update the requirements.txt to this:

requests[security]
six
colorama
requests==2.22.0
unidecode
pyOpenSSL
r0oth3x49 commented 5 years ago

I decided to debug it and found this error on the requests.get result, it was returning AttributeError with enter on the message, so I found this issue and installed requests==2.22.0 and it fixed the problem.

you should update the requirements.txt to this:

requests[security]
six
colorama
requests==2.22.0
unidecode
pyOpenSSL

I have never specified any specific version because any one can run the upgrade command against it and it will get the latest version available in repo. so basically the issue was with you requests not the tool, so i 'm closing the issue.

--upgrade command would have worked as well for requirements.txt instead of adding a specific