Giter Site home page Giter Site logo

coldsofttech / pym3u8downloader Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.44 MB

M3U8 Downloader is a Python class designed to download and concatenate video files from M3U8 playlists. This class provides functionality to handle M3U8 playlist files, download video segments, concatenate them into a single video file, and manage various error conditions.

License: MIT License

Python 100.00%
m3u8 m3u8-downloader m3u8-playlist

pym3u8downloader's Introduction

pym3u8downloader

M3U8 Downloader is a Python class designed to download and concatenate video files from M3U8 playlists, including master playlists. This class offers comprehensive functionality for managing M3U8 playlist files, downloading video segments, optionally combining them into a single video file, and handling various error conditions.

Installation

M3U8Downloader can be installed using pip:

pip install pym3u8downloader

Usage

from pym3u8downloader import M3U8Downloader

# Initialize the downloader
downloader = M3U8Downloader(
    input_file_path="http://example.com/video.m3u8",
    output_file_path="output_video"
)

# Download and concatenate the playlist
downloader.download_playlist()

# Download and concatenate the master playlist
downloader.download_master_playlist(name='720')

# Output
# Verify  : [##################################################] 100%
# Download: [##################################################] 100%
# Build   : [##################################################] 100%

Documentation

pym3u8downloader

M3U8Downloader

Constructors

  • M3U8Downloader(input_file_path: str, output_file_path: str, skip_space_check: Optional[bool] = False, debug: Optional[bool] = False, debug_file_path: Optional[str] = 'debug.log', max_threads: Optional[int] = 10): Initializes the M3U8Downloader object with the specified parameters.

Methods

  • download_playlist(merge: bool = True): Downloads video files from an M3U8 playlist. The optional merge parameter determines the handling of the downloaded segments. When merge is set to True, the method downloads and concatenates all video segments into a single output file. If merge is False, it only downloads the segments without concatenating them, keeping each segment as an individual file.
  • download_master_playlist(name: Optional[str] = None, bandwidth: Optional[str] = None, resolution: Optional[str] = None, merge: bool = True): Downloads video files from an M3U8 master playlist, with the specific variant selected based on optional parameters such as name, bandwidth, and resolution. The optional merge parameter determines the handling of the downloaded segments. When merge is set to True, the method downloads and concatenates all video segments into a single output file. If merge is False, it only downloads the segments without concatenating them, keeping each segment as an individual file.

Properties

  • input_file_path: Getter/setter property for the input file path.
  • output_file_path: Getter/setter property for the output file path.
  • skip_space_check: Getter/setter property for the skip space check flag.
  • debug: Getter/setter property for the debug flag.
  • debug_file_path: Getter/setter property for the debug file path.
  • max_threads: Getter/setter property for the maximum number of threads that can be executed in parallel.
  • is_download_complete: Getter property for the download completion status.

M3U8DownloaderError

This error class is employed to signal any issues or errors encountered during the execution of M3U8Downloader methods.

Constructors

  • M3U8DownloaderError(message: str): Initialize a M3U8DownloaderError.

Troubleshooting Guide

For detailed troubleshooting guide, please refer to TROUBLESHOOTING.

License

Please refer to the MIT License within the project for more information.

Contributing

We welcome contributions from the community! Whether you have ideas for new features, bug fixes, or enhancements, feel free to open an issue or submit a pull request on GitHub.

pym3u8downloader's People

Contributors

coldsofttech avatar

Watchers

 avatar

pym3u8downloader's Issues

I need to know something

How to use this
Can it be used like telegram bot
I have live m3u links how to rip content of a single channel at distinct time to distinct

Bug: Temp directory is not cleaned up

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.