Skip to content

Commit

Permalink
Merge pull request #4 from jaydenpung/jaydenpung
Browse files Browse the repository at this point in the history
Requests with cookies.txt
  • Loading branch information
dcrystalj authored Jan 2, 2019
2 parents c41bbf8 + bd5e7dd commit 4c6219b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion download.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
from subprocess import call
import requests
from requests.auth import HTTPBasicAuth
import http.cookiejar #For python 2 replace http.cookiejar with cookielib


def getIframeUrl(source, part):
r = requests.get(source)
cj = http.cookiejar.MozillaCookieJar('cookies.txt')
cj.load()

r = requests.get(source, cookies=cj)
bs = bs4.BeautifulSoup(r.content, 'lxml')
dest = 'https://fast.wistia.net/embed/iframe/{}'
id = bs.find('li', {'id': 'lesson-part-' + str(part)}).a['data-id']
Expand Down

18 comments on commit 4c6219b

@L-Coetzee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

How do I download the tutorial with this code?

@dcrystalj
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@L-Coetzee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok but I have no experience in python and don't know where to start.

Ps, does this include the paid tutorials?

@dcrystalj
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@L-Coetzee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do I do now?

@dcrystalj
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

google until you make it

@L-Coetzee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@L-Coetzee
Copy link

@L-Coetzee L-Coetzee commented on 4c6219b Oct 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find anything.

I did install python for vscode and pip but it gives an error: ModuleNotFoundError: No module named 'bs4'
I don't know what to do now your help would be much appreciated.

@dcrystalj
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run:
pip install beautifulsoup4
pip install requests

@L-Coetzee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok will try!

@L-Coetzee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zsh: command not found: pip

:(

@L-Coetzee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear to download the lessons I have to run the code in vscode correct?

@L-Coetzee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so I managed to download Beautifulsoup4.

What do I do next?

@L-Coetzee
Copy link

@L-Coetzee L-Coetzee commented on 4c6219b Oct 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vscode gives me the following problems:
Unable to import 'requests' pylint(import-error) [4,1]
Unable to import 'requests.auth' pylint(import-error) [5,1]

@L-Coetzee
Copy link

@L-Coetzee L-Coetzee commented on 4c6219b Oct 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for bothering you.
I managed to solve the can't import bs4 error.
Now vscode gives this error.

ImportError: No module named requests

@L-Coetzee
Copy link

@L-Coetzee L-Coetzee commented on 4c6219b Oct 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got everything working now!

The lessons are downloading at the moment!

Thanks for your help.

@DamnRicky
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got everything working now!

The lessons are downloading at the moment!

Thanks for your help.

@L-Coetzee could you please send me the videos you've just downloaded? Here is my email: [email protected]

@AydinBaghirov
Copy link

@AydinBaghirov AydinBaghirov commented on 4c6219b Jan 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your job... i have no issue in this code but just writing in output this but but there is no file in folder
downloading https://hdpiano.com/lesson/georgia-on-my-mind-by-ray-charles/#part-5

Process finished with exit code 0

from requests.auth import HTTPBasicAuth in my pycharm are grey //is this making trouble ?

Please sign in to comment.