Welcome Star?! Welcome to submit issues
This project won the special prize in the 2023 Ten Lines of Code Competition of the Tennis Association? Guidance? Github
Download the recorded video of Yanhe Classroom
Support downloading courses for non-elective classes
Support multi-threaded batch download
Supports downloading computer videos or classroom recordings
Save in folders classified by course name
2023-4-10 Synchronize Yanhe Classroom interface changes
2023-4-20 Change js execution mode without installing nodejs
2023-11-12 Optimize signature efficiency and optimize download speed
In theory, it can run a full Gigabit wired network, and the number of max_workers can be modified according to computer performance.
2024-4-2 (?)Change the signature implementation method
Give up js execution, no longer use js2py, improve compatibility issue#5
Now the time sign and url suffix are both native to py
2024-4-2 (?) Change the interaction mode and add complete command line parameters
Supports downloading all lessons at one time. Thanks to @ZJC-GH for your suggestions and PR.
Support downloading VGA and Video separately or simultaneously
Supports incremental downloads and automatically skips downloaded files
Change the temporary file storage location and place it in temp
You can customize the output folder location
For details, see #EATING METHOD
Optimize ffmpeg output
2024-4-3 (??) Added GUI interactive interface
Based on PySimpleGUI4, can run across platforms
Download the exe file in Releases
It is recommended to download the version with ffmpeg, such as yanhekt-xxx-gui-ffmpeg.exe
Run it directly and skip the following parts
https://pypi.org/project/yanhekt/
Install yanhekt
pip install yanhekt
Make sure the command line environment has ffmpeg
After downloading Windows, just add environment variables
Please search for relevant installation information by yourself
If the final video is not merged, there is a problem with the ffmpeg environment.
Download/clone this repository or download Releases
Install python dependency packages
pip install -r requirements.txt# (actually just one request)
Make sure there is ffmpeg in the command line environment (or in the code folder)
Windows simple method: download and copy to the code folder
The release of this repository comes with ffmpeg (exe only)
Please search for relevant installation information by yourself
If the final video is not merged, there is a problem with the ffmpeg environment.
Open method
If release exe, open it directly
If you use pip to install
yanhekt-gui yanhekt gui
If the source code runs
python main.py gui
Ready to eat right out of the box
Throw in the link or courseID (Ctrl-C V)
Get course information
Select the lesson time at will (Ctrl, Shift, mouse drag can be used to select multiple times)
Set some parameters, such as what videos to download
Open it!
NOTE: If installing from local source, replace yanhekt
or yanhekt-cli
in this section with python main.py
Get course ID
On the course details page, note that it is not the video playback page , such as https://www.yanhekt.cn/course/11111
.
Get the course id from the url, such as 11111
Command line parameters
--skip
, skip downloaded videos and only download newly uploaded videos
# Example: Regularly update all videos of the course yanhekt 11111 --all --skip
--dual
, download computer screen recording and classroom video at the same time** (default)**
--vga
, only download computer screen recordings
--video
, only download classroom videos
# Example: Download lessons 3-8, only download the computer screen recording yanhekt 11111 --range 3 9 --vga
--all
, download all lessons
--list 0 2 4
, download the selected lesson list
--range 3 5
, download lessons within a range
# Example: Download lessons 3-8 yanhekt 11111 --range 3 9 yanhekt 11111-L 3 9
, given directly
# Example: View course information and video list yanhekt 11111
Specify the ID of the course
Select the downloaded course number
Select the type of video to download
incremental download
For more advanced usage, please refer to the command line prompts.
!yanhekt --help# usage: main.py [-h] [-A | -L i [i ...] | -R i i] [-D | -G | -V] [-S] [-- dir DIR] [--max-workers num] courseID# GDDG08/YanHeKT_Downloader# positional arguments:# courseID Course ID of YanHeKT# options:# -h, --help show this help message and exit# Lesson Selection:# IF NONE, PRINT LESSON LIST AND EXIT.# -A, --all Download all lessons# -L i [i ...], --list i [i ...]# Select of lesson index (eg, --list 1 2 4)# -R i i, --range i i Select range of lessons (eg, --range 3 5 for [3,5))# Video Type:# -D, --dual Download both VGA(PC) and Video ( default)# -G, --vga Download VGA(PC) only# -V, --video Download Video only# Configurations:# -S, --skip Skip existing files# --dir DIR Output directory (eg, -- dir ./output)# --max-workers num Max workers for downloading (default: 32)
ENJOY!
Still in the early stages of development, feature requests and PRs are welcome
from yanhekt import YanHeKTyanhekt = YanHeKT(25555, _all=True, _dual=True, _skip=True, _dir='./')yanhekt.download()
@ZJC-GH classmate added batch download function
Students in need can download and use it from this warehouse release.
Currently merged into dev branch
Plan to use argparse
to improve command line parameters and optimize the interactive experience (implemented in 2.2.0)
(Super big pie) After the parameters are written, the entire simple gui
M3u8Download