r0oth3x49 / udemy-dl

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

Sometimes file types are not downloading all the time #524

Closed johndoe1969 closed 4 years ago

johndoe1969 commented 4 years ago

Describe the bug Sometimes files with py, json, and text extension are skipped from being downloaded

To Reproduce Steps to reproduce the behavior:

  1. udemy course url: https://www.udemy.com/course/python-for-beginners-learn-python-from-scratch
  2. Run the following command to reproduce the error... python udemy-dl.py https://www.udemy.com/course/python-for-beginners-learn-python-from-scratch/ -k cookie.txt -u my_emails_address -p my_password -q 1080 -o "../Udemy_-_Python_3_from_Beginner_to_Expert_-_Learn_Python_from_Scratch" --skip-sub
  3. See error... Asset : '006 arhitmetic-operators.py' (download skipped). [-] : Reason : int() argument must be a string or a number, not 'NoneType' or Asset : '075 namesurnames.txt' (download skipped). [-] : Reason : int() argument must be a string or a number, not 'NoneType' or Asset : '078 sample.json' (download skipped). [-] : Reason : int() argument must be a string or a number, not 'NoneType'

Expected behavior I expected the files to download like all other files (mp4, pdf, doc, txt, html, zip, py, json)

Screenshots If applicable, add screenshots to help explain your problem.

Python Environment (please complete the following information):

Additional context First time seeing this occur and only with this course. Some of the py and txt files did download, but most were skipped. All naming conventions were the same for files successfully downloaded and for those that were skipped. I manually downloaded a few of the files being skipped and opened them in vs codium. I didn't see any issues with contents of files i.e. not corrupt or empty files. Any suggestions? Update: It's happening on https://www.udemy.com/course/docker-tutorial/ as well.

r0oth3x49 commented 4 years ago

can you reproduce the same with python3? i will remove python2 version in the up coming update soon.

johndoe1969 commented 4 years ago

I installed Python 3.6.9. You can't run the script with "python3", it has to just be "python".

So, I had to set an alias in my .bashrc (alias python=/usr/bin/python3) or else just using python to run the script would default to my python 2.7 version. I was able to then run python -V and the result was 3.6.9.

Anyway, I re-tried https://www.udemy.com/course/python-for-beginners-learn-python-from-scratch and again some of the .py files would not download and gave same error message.

For example two consecutive files: 021 loops.py downloaded ok, but 022 loops.py did NOT download. It's really weird and doesn't make sense as to why.

If you change coming update to remove python2, can you modify script to run with or accept either the word(s) "python" or "python3". This will prevent confusion and avoid having to make an alias for those that have both versions of python (2 or 3) installed. Thanks!

r0oth3x49 commented 4 years ago

hmmm then i might need your creds to reproduce and fix i cannot reproduce with the courses i have in my account or you can link any free course here which also causes the same issue so that i can fix it.

johndoe1969 commented 4 years ago

I don't believe that my alias took effect yesterday and when I ran the script again I think it was still using python version 2.7. Running "source .bashrc" or ". ~/.bashrc" from the command line doesn't truly reload bashrc even though python -V returned 3.6.9 (I think scripts were still running with 2.7). Because now that I have rebooted my computer and I run the udemy-dl script with "python" I am now getting the following:

Traceback (most recent call last): File "udemy-dl.py", line 7, in import udemy File "/home/john/Downloads/udemy-dl-master_pythonVersion/udemy/init.py", line 32, in from ._udemy import course File "/home/john/Downloads/udemy-dl-master_pythonVersion/udemy/_udemy.py", line 26, in from ._internal import InternUdemyCourse as Udemy File "/home/john/Downloads/udemy-dl-master_pythonVersion/udemy/_internal.py", line 29, in from ._colorized import File "/home/john/Downloads/udemy-dl-master_pythonVersion/udemy/_colorized/init.py", line 25, in from .colors import File "/home/john/Downloads/udemy-dl-master_pythonVersion/udemy/_colorized/colors.py", line 25, in from colorama import init,Fore,Back,Style ModuleNotFoundError: No module named 'colorama'

I deleted the alias and rebooted my computer. Now python -V shows 2.7 again and the udemy-dl script runs without error. It appears to me that udemy-dl doesn't like python3 (even if the alias labels python3 as python)....at least that's how it appears on my computer.

Is there a way to run udemy-dl with python3...for example....

python3 udemy-dl https://www.udemy.com/course/python-for-beginners-learn-python-from-scratch/ -k cookie.txt -u my_emails_address -p mypassword -q 1080 -o "../Udemy-_Python_3_from_Beginner_toExpert-_Learn_Python_from_Scratch" --skip-sub

r0oth3x49 commented 4 years ago

I don't believe that my alias took effect yesterday and when I ran the script again I think it was still using python version 2.7. Running "source .bashrc" or ". ~/.bashrc" from the command line doesn't truly reload bashrc even though python -V returned 3.6.9 (I think scripts were still running with 2.7). Because now that I have rebooted my computer and I run the udemy-dl script with "python" I am now getting the following:

Traceback (most recent call last): File "udemy-dl.py", line 7, in import udemy File "/home/john/Downloads/udemy-dl-master_pythonVersion/udemy/init.py", line 32, in from ._udemy import course File "/home/john/Downloads/udemy-dl-master_pythonVersion/udemy/_udemy.py", line 26, in from ._internal import InternUdemyCourse as Udemy File "/home/john/Downloads/udemy-dl-master_pythonVersion/udemy/_internal.py", line 29, in from ._colorized import File "/home/john/Downloads/udemy-dl-master_pythonVersion/udemy/_colorized/init.py", line 25, in from .colors import File "/home/john/Downloads/udemy-dl-master_pythonVersion/udemy/_colorized/colors.py", line 25, in from colorama import init,Fore,Back,Style ModuleNotFoundError: No module named 'colorama'

I deleted the alias and rebooted my computer. Now python -V shows 2.7 again and the udemy-dl script runs without error. It appears to me that udemy-dl doesn't like python3 (even if the alias labels python3 as python)....at least that's how it appears on my computer.

Is there a way to run udemy-dl with python3...for example....

python3 udemy-dl https://www.udemy.com/course/python-for-beginners-learn-python-from-scratch/ -k cookie.txt -u my_emails_address -p mypassword -q 1080 -o "../Udemy-_Python_3_from_Beginner_toExpert-_Learn_Python_from_Scratch" --skip-sub

the error says you don't have dependencies, install the dependencies for python3 first then it will work

johndoe1969 commented 4 years ago

the error says you don't have dependencies, install the dependencies for python3 first then it will work

LOL...yeah that would help wouldn't it?!?! :roll_eyes:

Ok, so I did that and was able to run python3 udemy-dl........................

Same issue(s), most of the .py, .txt, and .json files would not download and returned the same error as mentioned previously.

I give up! I'm not worried about it though. I'll mess around some more and see what else I can break.

xiskillo commented 4 years ago

I have the same issue "Reason : int() argument must be a string, a bytes-like object or a number, not 'NoneType'"

The problem happen when try download for example download video and assets called XXX.txt and sameXXX.txt.zip

First asset xxx.txt.zip was downloaded well and next file xxx.txt got this error message.

On windows system, conda, and tested in python 3.7 and 3.8

r0oth3x49 commented 4 years ago

i have added a label that i can't reproduce with the courses i have in my account, if you guys can share your credentials i will try to reproduce with the same course you downloading and will be able to fix it ASAP otherwise you will have to wait until i can reproduce the issue on the courses i have.

Thanks

Laiteux commented 4 years ago

I have an account enrolled in a course having txt assets so this issue.

I sent the full details to nasir251292@gmail.com from matt@laiteux.dev

Let me know!

r0oth3x49 commented 4 years ago

I have an account enrolled in a course having txt assets so this issue.

I sent the full details to nasir251292@gmail.com from matt@laiteux.dev

Let me know!

thanks bro i will check the email, try to reproduce and fix ASAP.

xd003 commented 4 years ago

can confirm facing this same issue on a course i have , if @r0oth3x49 you were able to reproduce this issue using the account of the guy who emailed you then fine , otherwise just let me know i will email you my account id_pass or an active cookie directly where you can reproduce it

r0oth3x49 commented 4 years ago

I have an account enrolled in a course having txt assets so this issue.

I sent the full details to nasir251292@gmail.com from matt@laiteux.dev

Let me know!

i didn't get any creds on my email are you sure you emailed?

r0oth3x49 commented 4 years ago

can confirm facing this same issue on a course i have , if @r0oth3x49 you were able to reproduce this issue using the account of the guy who emailed you then fine , otherwise just let me know i will email you my account id_pass or an active cookie directly where you can reproduce it

would be great if you can share your creds, i didn't received creds from any one yet, i managed to get the time out for fixing and upgrading tool, If you share it by today earlier then i will be able to fix this think as well.

email me on nasir251292@gmail.com, please share the following in email.

Laiteux commented 4 years ago

I have an account enrolled in a course having txt assets so this issue. I sent the full details to nasir251292@gmail.com from matt@laiteux.dev Let me know!

i didn't get any creds on my email are you sure you emailed?

I did and just did again but this time from laiteuxxx@gmail.com, please check now and let me know

r0oth3x49 commented 4 years ago

I have an account enrolled in a course having txt assets so this issue. I sent the full details to nasir251292@gmail.com from matt@laiteux.dev Let me know!

i didn't get any creds on my email are you sure you emailed?

I did and just did again but this time from laiteuxxx@gmail.com, please check now and let me know

got it now thanks man, please share the course url to reproduce the issue so that i can directly go for the fix instead of investigating where and on which course it is.

r0oth3x49 commented 4 years ago

aah got that as well in the email sorry.

Laiteux commented 4 years ago

@r0oth3x49 even through you got the already got the credentials to reproduce the issue , i still sent you mine for 2 reasons

  1. it will be better to confirm on 2 courses once you have debugged fixed this issue.
  2. This issue reported my here - #529 It seems to be course specific and doesn't happen on all courses

Hence i sent my credentials so that you can take care of both the issues together

Please check , you must have got the email from singhbadal04@gmail.com

Beware, you made your account password public even tho your edited your message and everyone can now access your Udemy account!

xd003 commented 4 years ago

@r0oth3x49 Even through you got the already got the credentials to reproduce the issue , i still sent you my udemy account details for 2 reasons

1) t will be better to confirm on 2 courses once you have debugged and fixed this issue.

2) This issue reported my here - #529 . It seems to be course specific issue and doesn't happen on all courses

Hence i sent my credentials so that you can take care of both the issues together

Please check , you must have got the email from singhbadal04@gmail.com

xd003 commented 4 years ago

@Laiteux thanks for reminding me .Although i did by mistake and had edited it in seconds but didnt knew github keeps edit history as well

r0oth3x49 commented 4 years ago

@r0oth3x49 Even through you got the already got the credentials to reproduce the issue , i still sent you my udemy account details for 2 reasons

1. t will be better to confirm on 2 courses once you have debugged and fixed this issue.

2. This issue reported my here - #529 . It seems to be course specific issue and doesn't happen on all courses

Hence i sent my credentials so that you can take care of both the issues together

Please check , you must have got the email from singhbadal04@gmail.com

okay now you don't need to worry i have deleted your edit revisions and people will only access the recent version of edit older ones are delete, please always make sure you don't share such things on public.

that's why i always ask to email instead. i will check the email.

what you can do is simply change your password right now and send me the new creds on email nasir251292@gmail.com that would be fine

xd003 commented 4 years ago

@r0oth3x49 sent updated password just now