Giter Club home page Giter Club logo

m3u8downloader's Introduction

M3u8-dl

alt text alt text alt text

M3u8-dl is a simple command-line util which downloads m3u8 file.

Install

pip install m3u8-dl

Usage

Get the HLS Request infomation from web browser with Developer Tools. Such As Request URL and Referer.

# HLS_URL -> Request URL
# OUTPUT -> such as example.ts
m3u8-dl HLS_URL OUTPUT
# code below may not work since the website server may reject an out-of-date request
m3u8-dl https://proxy-038.dc3.dailymotion.com/sec\(4pkX4jyJ09RyW9jaEyekktbBu55uix9cMXQu-o5e13EelVKd1csb9zYSD66hQl7PlA_V5ntIHivm_tuQqkANmQj8DbX33OMJ5Db-9n67_SQ\)/video/795/864/249468597_mp4_h264_aac.m3u8 example.ts -u https://proxy-038.dc3.dailymotion.com/sec\(4pkX4jyJ09RyW9jaEyekktbBu55uix9cMXQu-o5e13EelVKd1csb9zYSD66hQl7PlA_V5ntIHivm_tuQqkANmQj8DbX33OMJ5Db-9n67_SQ\)/video/795/864/ -r https://www.dailymotion.com/video/x44iz79

# restore last session if the task was interrupted
m3u8-dl --restore

If you are failed to download the stream, try it again with the options below:

  • Specify the Referer with -r when you're blocked by the website (403 forbidden).
  • Specify the base url with -u when #EXTINF hls-720p0.ts has no base url in output.m3u8.

You can even make it run faster by using -t, which means how many threads you want to start.

--restore will restore the last session.

For more details, check --help.

Notes

  • Version 0.2.0

    1. Add support to local m3u8 files. For example
    m3u8-dl file:///Users/username/Downloads/master.m3u8 example.ts
    
    1. Create a fake m3u8 file depends on ts range. For example
    m3u8-dl -f master.m3u8 -r 1,100 --ts [email protected]?validfrom=1581996390&validto=1582003590&ip=89.187.161.206&hdl=-1&hash=rz91LEl6l%2FSZH83nXkv5BXzUhOQ%3D
    

m3u8downloader's People

Contributors

kedpter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

m3u8downloader's Issues

Feature - Silent Mode

Hi! I'm using your script to make a script to download some videos from a website. Well, it's working pretty well, the point is the terminal is so dirty. There's a way to hide all informations given and show only the progress bar of segments downloading?

Thanks for the support and for the code, it's helping me a lot!
ps: I loved the thread function, it's amazing, I've made some tests and works really nice.

Edit1: I'm calling the script with CMD and passing the parameters I need. I don't know if this is the best way , but I thinks it's the most easy. If there's another way to use it (and more simple), please tell me.

MyCode

Feature Request : Support insecure SSL (ignore SSL check)

  • m3u8_dl version: 0.1.5
  • Python version: Python 3.7.3rc1
  • Operating System: Debian Buster (4.19.0-2-amd64 #1 SMP Debian 4.19.16-1 (2019-01-17) x86_64 GNU/Linux)

Description

Some streaming servers, whilst protected with SSL, do not have full certificate chain.

This causes urllib3 to fail, in similar to

  File "/home/mason/myenv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/home/mason/myenv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/home/mason/myenv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "/home/mason/myenv/lib/python3.7/site-packages/urllib3/connection.py", line 326, in connect
    ssl_context=context)
  File "/home/mason/myenv/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.7/ssl.py", line 412, in wrap_socket
    session=session
  File "/usr/lib/python3.7/ssl.py", line 853, in _create
    self.do_handshake()
  File "/usr/lib/python3.7/ssl.py", line 1117, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)

Request

Proposal to add parameter, such as --no-check-certificate or --insecure

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.