This project enable web scrapping for video that come with most common file extension; .mp4, .ts, .m4s, which normally require .m3u8 playlist.
What is m3u8 file?
A file with the M3U8 file extension is a UTF-8 encoded playlist file. M3U8 files are plain text files that can be used to store the URL paths of streaming audio or video and information about the media tracks. (VIVE BUSINESS, 2023)
Able to extract and access the URL paths of streaming video (which will be a ts video file in multiple segments) to download the contents.
-
Setup environment
git clone <this repo> pip3 install -r requirements.txt
Make sure to obtain the .mp4 or .m3u8 link.
How to get .m3u8 link
Run the following command and navigate to the application server (e.g. http://127.0.0.1:3000).
flask --app app run --port 3000Note: Only support MP4 video download for now.
Run the following script.
python3 video_downloader.py "<the_link>" --name-file-as custom_nameOptional Example Files to Use
python3 main.py "<the link>" ./downloaded_video/ <name the file as you like>python3 main.py "<the_link>" ./downloaded_video/ "<website_link>"Notes: Make sure to always set the html element that you would like to target (example2-4).
Create 2 txt file for video url and website url compilation.
Save all the video url and website url in respective txt file.
python3 main.py "<videos_url_file_path>" "<websites_url_file_path>" ./downloaded_video/python3 main.py "<videos_url_file_path>" "<websites_url_file_path> ./downloaded_video/"If successful you will get the downloaded file in "downloaded_video" folder.
- Add Progress Bar
- Create a simple UI and executable program
- Catch connection error to avoid re-download
- Write unittest
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
Thanks to:
- Coding Bunch For the tutorial video on how to donwload ts video file via m3u8. Highly recommend others to watch, he explained the whole system very well!
- Globo.com For providing a great repo on loading m3u8 file format.
Thanks for making it free and a source for educational purpose.
This project does not suggest/recommend/encourage copyright infringement of anykind.
