Skip to content

Commit

Permalink
version1.0-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
touhid314 committed Jun 23, 2023
1 parent 4f71e07 commit ad5c2f6
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
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.

![image](https://github.com/touhid314/Coursera-Downloader/assets/69526008/be86a9bd-f984-472a-bb71-75e6eb7d162d)
![image](https://github.com/touhid314/Coursera-Downloader/assets/69526008/6b210f4e-837e-489d-83b9-6c6940cae660)
![image](https://github.com/touhid314/Coursera-Downloader/assets/69526008/13a145e5-3c28-4630-bce0-32267fc3a690)
Binary file added coursera_dl.exe
Binary file not shown.
Binary file added data.bin
Binary file not shown.
70 changes: 70 additions & 0 deletions general.py
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))
10 changes: 10 additions & 0 deletions requirements.txt
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 added setup_file/CourseraDownloader_v1.0.exe
Binary file not shown.
19 changes: 19 additions & 0 deletions todo.txt
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

0 comments on commit ad5c2f6

Please sign in to comment.