-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
touhid314
committed
Jun 23, 2023
1 parent
4f71e07
commit ad5c2f6
Showing
7 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Coursera-Downloader | ||
|
||
a gui on top of the coursera-dl script for easy downloading of coursera courses | ||
|
||
Site for downloading the windows app: http://coursera-downloader.rf.gd/ | ||
|
||
# Description | ||
|
||
Download videos, assignments, notes and all other resources of a course saved week by week just as in the course. | ||
|
||
 | ||
 | ||
 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import re | ||
import browser_cookie3 as bc | ||
|
||
# this dictionary holds language name as key and corresponding ISO language code as value | ||
LANG_NAME_TO_CODE_MAPPING = {'Arabic': 'ar', 'Afrikaans': 'af', | ||
'Bangla': 'bn', 'Burmese': 'my', | ||
'Chinese (Simplified)': 'zh-Hans', 'Chinese (Traditional)': 'zh-Hant', 'Chinese': 'zh', | ||
'Dutch': 'nl', | ||
'English': 'en', | ||
'French': 'fr', 'Finnish': 'fi', | ||
'Greek': 'el', | ||
'Hindi': 'hi', | ||
'Italian': 'it', | ||
'Japanese': 'ja', | ||
'Korean': 'ko', | ||
'Malay': 'ml', 'Malayalam': 'ml', | ||
'Portugese': 'pt', | ||
'Russian': 'ru', | ||
'Spanish': 'es', | ||
'Tamil': 'ta', 'Telegu': 'te', 'Thai': 'th', 'Turkish': 'tr', | ||
'Urdu': 'ur', | ||
'Vietnamese': 'vi', | ||
'-ALL AVAILABLE': 'all', '-NONE': ''} | ||
|
||
|
||
# extract class name from course home page url | ||
def urltoclassname(homepageurl): | ||
'''this function assumes that the url is of this format: | ||
coursera.org/learn/CLASSNAME/more thing... | ||
if the url isn't in this format, program won't work''' | ||
|
||
classname = '' | ||
|
||
if ('/' in homepageurl) or ('\\' in homepageurl): | ||
classname = re.findall( | ||
'coursera.org/learn/(.+?)/', homepageurl.lower()) | ||
classname = ''.join(classname) # convert list to string | ||
else: | ||
# if homepageurl doesn't contain slash treat it as just a string | ||
# 'python-network-data' would output 'python-network-data' | ||
classname = homepageurl | ||
|
||
return classname | ||
|
||
|
||
def loadcauth(domain): | ||
'''this function returns the cauth code of browser for the specified domain. | ||
example use: loadcauth('coursera.org'). the function searches only in the cookie | ||
files of chrome and firefox. if there is no cauth for the domain function returns | ||
an empty string''' | ||
cj = bc.load(domain_name=domain) | ||
|
||
strcookie = str(cj) | ||
cauth = re.findall('CAUTH=(.*?)\s', strcookie) | ||
|
||
# print(strcookie) | ||
# print(len(cauth)) | ||
if len(cauth) > 0: | ||
cauth = cauth[0] | ||
else: | ||
cauth = '' | ||
|
||
return cauth | ||
|
||
|
||
# print(loadcauth('coursera.org')) | ||
|
||
|
||
# url = r"python" | ||
# print(urltoclassname(url)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
varname | ||
browser-cookie3 | ||
beautifulsoup4 | ||
requests | ||
six | ||
urllib3 | ||
pyasn1 | ||
keyring | ||
configargparse | ||
attrs==18.1.0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#keep everything 32 bit or 64 bit, otherwise things get messed up at some points, program don't work | ||
|
||
#for maingui: | ||
|
||
pip install varname browser-cookie3 | ||
|
||
|
||
#for coursera-dl to run as python progrram, not as a exe file: | ||
|
||
pip install beautifulsoup4 requests six urllib3 pyasn1 keyring configargparse attrs==18.1.0 | ||
|
||
|
||
#pyinstaller | ||
|
||
use python v3.7, otherwise pyinstaller doesn't work, shows error | ||
|
||
pip install pyinstaller | ||
pip uninstall enum34 #this module causes error for pyinstaller installation | ||
|