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

README.md - Extracting Cookies / Request Headers is unclear #389

Closed morkeltry closed 5 years ago

morkeltry commented 5 years ago

Now click on My Courses in the Udemy navbar and refresh the page you will see some requests under Network Tab. Right click on request links to udemy.com/api-2.0/. Simply copy Request Headers and save to text file.

These instructions really are not clear. I would suggest to improve "Right click on request links to udemy.com/api-2.0/" to specify which request link to udemy.com/api-2.0/ - if any one is OK, then specify that. "Simply copy Request Headers and save to text file.": there are Request Headers displayed lower down in Dev Tools. To specify that you can save the headers via the right click context menu: "Right click on... and select 'Copy Request Headers' from the context menu". "and save to text file." -> "The headers are now in the clipboard. Paste them into a text file and save it to the udemy-dl directory"

So far so good?

Now the next point I cannot suggest a phrasing for as I could not work out what the instruction is trying to do. "Done run the udemy-dl against that text file it will start downloading the course."

What does it mean to run udemy-dl "against" a text file? I cannot see any option to use a text file as parameters to udemy-dl .

01ttouch commented 5 years ago

😋 Simple 5 steps login with cookie for Firefox users

1) Make sure you already logged in. Right click anywhere on the udemy website and choose Inspect Element or you can press shortcut button F12

firefox1

2) Choose Storage tab, then choose Cookies -> https://www.udemy.com on the left.

On the right, type into filter: access_token, double click and copy the value inside Value box.

firefox2

3) Create a text (.txt) file inside your udemy-dl folder, name it whatever you want.

firefox4

4) Open the text (.txt) file you just created. Add the line below to it, replace yourAccessToken with the value in Step 2 and save the file.

access_token=yourAccessToken

firefox3

5) Use the command below to login and download with cookie. Replace courseUrl with your course url, cookie.txt with the name of file you created in Step 3

python udemy-dl.py courseUrl -k cookie.txt

firefox5

r0oth3x49 commented 5 years ago

Now click on My Courses in the Udemy navbar and refresh the page you will see some requests under Network Tab. Right click on request links to udemy.com/api-2.0/. Simply copy Request Headers and save to text file.

These instructions really are not clear. I would suggest to improve "Right click on request links to udemy.com/api-2.0/" to specify which request link to udemy.com/api-2.0/ - if any one is OK, then specify that. "Simply copy Request Headers and save to text file.": there are Request Headers displayed lower down in Dev Tools. To specify that you can save the headers via the right click context menu: "Right click on... and select 'Copy Request Headers' from the context menu". "and save to text file." -> "The headers are now in the clipboard. Paste them into a text file and save it to the udemy-dl directory"

So far so good?

Now the next point I cannot suggest a phrasing for as I could not work out what the instruction is trying to do. "Done run the udemy-dl against that text file it will start downloading the course."

What does it mean to run udemy-dl "against" a text file? I cannot see any option to use a text file as parameters to udemy-dl .

thanks @01ttouch , lets wait for @morkeltry reply if he still face problem in understanding. did you get the idea from above explanation by @01ttouch ?

01ttouch commented 5 years ago

chrome Simple 5 steps login with cookie for Chrome users

1) Make sure you already logged in. Right click anywhere on the udemy website and choose Inspect or you can press shortcut button F12

chrome1

2) Choose Application tab, then choose Cookies -> https://www.udemy.com on the left.

On the right, type into filter: access_token, double click and copy the value inside Value box.

chrome2

3) Create a text (.txt) file inside your udemy-dl folder, name it whatever you want.

chrome3

4) Open the text (.txt) file you just created. Add the line below to it, replace yourAccessToken with the value in Step 2 and save the file.

access_token=yourAccessToken

chrome4

5) Use the command below to login and download with cookie. Replace courseUrl with your course url, cookie.txt with the name of file you created in Step 3

python udemy-dl.py courseUrl -k cookie.txt

chrome5

longlosthope commented 5 years ago

Does it rip off any course or do I have to own it?

tavitooo commented 5 years ago

Ey Its only for course you buy! not for download any courses in Udemy!!. :(

tavitooo commented 5 years ago

Does it rip off any course or do I have to own it?

Only Own it... :(

sidx64 commented 4 years ago

Considering how cheap the courses are, I dont see why the sad face :P

noorbala7418 commented 4 years ago

thank you.it was great!

dlwhittenbury commented 4 years ago

Thank you, it worked perfectly.

Raqibur-Rahman commented 4 years ago

It says "python: can't open file 'udemy-dl.py': [Errno 2] No such file or directory" I never use python before,I have installed it . Now, what should I do?

noorbala7418 commented 4 years ago

you should go to udemy-dl directory.with command ' ls ' you can see script on the terminal.then you can run udemy-dl.py with this command: python udemy-dl link -k cookieFile.txt

S-Tangg commented 4 years ago

hi, get this warning: It seems either you are not enrolled or you have to visit the course atleast once while you are logged in. But I am sure I have logged in and also visit the course already, any tips?

r0oth3x49 commented 4 years ago

hi, get this warning: It seems either you are not enrolled or you have to visit the course atleast once while you are logged in. But I am sure I have logged in and also visit the course already, any tips?

@S-Tangg did you manage to download course other than the one you are facing the error?

matthewmerks commented 4 years ago

Can confirm this works. Followed this now after receiving a 403 and access_token cleared the error and allowed downloads to resume.

gkpavan commented 4 years ago

Hi, Did anybody downloaded the Udemy business enrolled course using this git.

dillagr commented 4 years ago

Hi, Did anybody downloaded the Udemy business enrolled course using this git.

yes, it works

Pedro1Torres commented 4 years ago

Unable to find access_key solution not working on chrome?

noorbala7418 commented 4 years ago

Unable to find access_key solution not working on chrome? access_token is true not access_key !

osazemeu commented 4 years ago

@Pedro1Torres just tried it now... It works on chrome.

Raqibur-Rahman commented 4 years ago

you should go to udemy-dl directory.with command ' ls ' you can see script on the terminal.then you can run udemy-dl.py with this command: python udemy-dl link -k cookieFile.txt

Sorry,I didn't understand.Will you please say it again?

azmatsiddique commented 4 years ago

thank you soo much

Ocolus1 commented 4 years ago

Thank you so much It worked

luboq commented 4 years ago

Note that encoding of cookie.txt must be ANSI. On non-latin's system, default encoding of new created .txt files may be UTF8, took me a little to troubleshoot.

shubham0804 commented 3 years ago

In the cookies it says that the access_token expires in about a month. Would a new access token have to be entered in udemy-dl when the current one expires?

r0oth3x49 commented 3 years ago

In the cookies it says that the access_token expires in about a month. Would a new access token have to be entered in udemy-dl when the current one expires?

definitely you should if you want udemy-dl to work.

magheralex commented 3 years ago

[*] : Trying to login using cookies ... [+] : Logged in successfully. [-] : Udemy Says : 403 Forbidden You should use cookie base method to authenticate or try again in few minutes ...

ahmet-soner commented 3 years ago

Traceback (most recent call last): File "C:\Users\MYSTIC\Desktop\udemy-dl-master\udemy-dl-master\dersindir.py", line 1 python https://www.udemy.com/course/assembly-kapsaml-egitimi-ile-uzmanlga-dogru/learn/lecture/19879416#overview -k prsk.txt ^ SyntaxError: invalid syntax


what is the solution? prgfiles@gmail.com

riteshbehera857 commented 3 years ago

where will be the files saved after being downloaded

kaptX commented 3 years ago

Trying to login using session cookie [i] : Logged in successfully. [-] : Udemy Says: 403 Forbidden on https://www.udemy.com...........................

Is there a solution for this? I used this like two months ago and now it's not working.

bhantsi commented 3 years ago

Ok I got four errors as shown in the screenshot below udemy-dl

ghost commented 3 years ago

sadece bedava olanları indirebiliyor !? koyy

ghost commented 3 years ago

Tamam, aşağıdaki ekran görüntüsünde gösterildiği gibi dört hata aldım udemy-dl

hala çözemediysen ve çözemeyenler için onu python3 ile çalıştırman gerekiyor

abedevjs commented 3 years ago

Ok I got four errors as shown in the screenshot below udemy-dl

you have to install the requirements.txt first

ghost commented 3 years ago

The id of the course can be found on this site. Can we tell udemy-dl that it should use this id? https://www.infognu.com/udemy-course-date-finder

VelkanLynd commented 3 years ago

Hi, when i iuse python udemy-dl.py -k cookies.txt URL get this error Traceback (most recent call last): File "C:\Apps\udemy-dl\udemy-dl.py", line 660, in main() File "C:\Apps\udemy-dl\udemy-dl.py", line 559, in main f_in = open(args.cookies) FileNotFoundError: [Errno 2] No such file or directory: 'cookies.txt'

ghost commented 3 years ago

Merhaba, python udemy-dl.py -k cookie.txt URL'sini kullandığımda bu hatayı alıyorum Geri İzleme (en son çağrı son): Dosya "C:\Apps\udemy-dl\udemy-dl.py", satır 660, main() Dosya "C:\Apps\udemy-dl\udemy-dl.py", satır 559, ana f_in = open(args.cookies) içinde FileNotFoundError: [Errno 2] Böyle bir dosya veya dizin yok: 'cookies.txt '

Hepsinin bir çözümü var ama benim senden önceki yanıtımda dediğim olmazsa hiçbir anlamı yok!,ve zaten udemydeki kursları indirmek için normal programlar var bu kadar uğraşmaya gerek yok (benim dediğim olmadığı sürece) çünkü bu zımbırtı sadece satın aldığımız kursları indirebiliyor benim dediğim olmadıgı sürece bir anlamı yok!!

abedevjs commented 3 years ago

Hi, when i iuse .....

try this python udemy-dl.py -k cookies

ghost commented 3 years ago

All of them have a solution, but it doesn't make any sense unless I said in my previous answer!, and there are already normal programs to download courses on udemy, no need to try so hard (as I said.

sounroy commented 3 years ago

you should go to udemy-dl directory.with command ' ls ' you can see script on the terminal.then you can run udemy-dl.py with this command: python udemy-dl link -k cookieFile.txt

I am getting the following usage: udemy-dl [-h] [-u USERNAME] [-p PASSWORD] [--lecture-start LECTURE_START] [--lecture-end LECTURE_END] [-o OUTPUT] [-d {aria2c,axel,httpie,curl}] [--use-ffmpeg] [-q VIDEO_QUALITY] [-s] [--safe-file-names] [-l] [--debug] [-v] link udemy-dl: error: unrecognized arguments

ghost commented 3 years ago

Course ID can be found on this site. Can we tell udemy-dl to use this ID? https://www.infognu.com/udemy-course-date-finder