Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

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

Closed
morkeltry opened this issue May 13, 2019 · 40 comments
Closed

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

morkeltry opened this issue May 13, 2019 · 40 comments

Comments

@morkeltry
Copy link

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
Copy link

😋 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

  1. 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

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

firefox4

  1. 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

  1. 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
Copy link
Owner

r0oth3x49 commented May 13, 2019

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
Copy link

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

  1. 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

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

chrome3

  1. 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

  1. 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
Copy link

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

@tavitooo
Copy link

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

@tavitooo
Copy link

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

Only Own it... :(

@sidx64
Copy link

sidx64 commented Apr 12, 2020

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

@ZevFung ZevFung mentioned this issue Apr 25, 2020
@noorbala7418
Copy link

thank you.it was great!

@dlwhittenbury
Copy link

Thank you, it worked perfectly.

@Raqibur-Rahman
Copy link

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
Copy link

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
Copy link

S-Tangg commented May 10, 2020

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
Copy link
Owner

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
Copy link

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

@gkpavan
Copy link

gkpavan commented May 11, 2020

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

@dillagr
Copy link

dillagr commented May 11, 2020

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

yes, it works

@Pedro1Torres
Copy link

Unable to find access_key solution not working on chrome?

@noorbala7418
Copy link

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

@osazemeu
Copy link

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

@Raqibur-Rahman
Copy link

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
Copy link

thank you soo much

@Ocolus1
Copy link

Ocolus1 commented Jul 7, 2020

Thank you so much It worked

@luboq
Copy link

luboq commented Nov 18, 2020

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
Copy link

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
Copy link
Owner

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
Copy link

[*] : 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
Copy link

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
Copy link

where will be the files saved after being downloaded

@kaptX
Copy link

kaptX commented May 2, 2021

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
Copy link

bhantsi commented Jun 7, 2021

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

@ghost
Copy link

ghost commented Jun 11, 2021

sadece bedava olanları indirebiliyor !?
koyy

@ghost
Copy link

ghost commented Jun 11, 2021

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
Copy link

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

you have to install the requirements.txt first

@ghost
Copy link

ghost commented Jun 13, 2021

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
Copy link

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
Copy link

ghost commented Jun 14, 2021

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
Copy link

Hi, when i iuse
.....

try this python udemy-dl.py -k cookies

@ghost
Copy link

ghost commented Jun 17, 2021

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
Copy link

sounroy commented Jul 12, 2021

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
Copy link

ghost commented Jul 20, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests