Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary

The GitIrDownloader class is responsible for downloading lessons from a website called git.ir. It sets up the download path, retrieves the course URLs, and downloads the lessons.

Code Analysis

Main functionalities

The main functionalities of the GitIrDownloader class are:

  • Setting up the download path for the lessons.
  • Retrieving the course URLs.
  • Downloading the lessons.

Methods

The GitIrDownloader class has the following methods:

  • __post_init__(): Initializes the class and calls the pre_download() method.
  • setup_download_path(course_name): Sets up the download path for the lessons based on the course name.
  • pre_download(): Calls the raw_course_handler() and download() methods.
  • get_lesson(url): Retrieves the lesson information (course name and lesson name) from the given URL.
  • get_course_name(url): Extracts the course name from the given URL.
  • download(): Downloads the lessons by iterating over the course URLs and calling the get_lesson() method for each URL.
  • get_raw_courses(): Reads the raw courses from a file and returns them as a list.
  • get_course_urls(): Reads the course URLs from a JSON file and returns them.
  • raw_course_handler(): Handles the raw courses by calling the get_raw_courses() method and writing the courses to a JSON file.

Fields

The GitIrDownloader class has the following field:

  • download_path: The path where the downloaded lessons will be saved.

Example Usage

  • open the git.ir course download page

  • click on "copy all to clipboard"

  • paste the content into "raw_courses" file

  • run python main.py

About

git.ir videos downloader

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages