Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do I command m3u8 video and audio links #31331

Open
3 tasks done
ecchirealm opened this issue Nov 7, 2022 · 3 comments
Open
3 tasks done

how do I command m3u8 video and audio links #31331

ecchirealm opened this issue Nov 7, 2022 · 3 comments
Labels

Comments

@ecchirealm
Copy link

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

So I have a video m3u8 url and a mp3 m3u8 url, downloading them separately works but I don't know how to combine the m3u8 urls in one command.
Here is the example of the video url command:

youtube-dl -o Sleepless_episode_2.mkv "https://va04-edge.tmncdn.io/wp-content/uploads/Sleepless/episode_2/media-1/stream.m3u8/" --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" --referer "https://muchohentai.com/" --no-check-certificate

this is the audio url:
https://va02-edge.tmncdn.io/wp-[content/uploads/Sleepless/episode_2/audio/aac/ja/stream.m3u8

is there a way to implement adding the audio url to the above video url command.

thank you for any help!!

@dirkf
Copy link
Contributor

dirkf commented Nov 7, 2022

Use ffmpeg, as yt-dl does when downloading video+audio formats to combine the individual formats into a single output container.

In this case you shouldn't have needed yt-dl at all, as ffmpeg can use the m3u8 stream URLs directly as input, something like: ffmpeg -i video_url -i audio_url out.mkv. If any of the streams has already been downloaded you can use the filename instead of the URL.

@ecchirealm
Copy link
Author

how do I write the referrer, useragent into the command?

@dirkf
Copy link
Contributor

dirkf commented Nov 7, 2022

Use the command options that ffmpeg provides for just those purposes.

$ ffmpeg -hide_banner -h protocol=http
http AVOptions:
  -seekable          <boolean>    .D........ control seekability of connection (default auto)
  -chunked_post      <boolean>    E......... use chunked transfer-encoding for posts (default true)
  -http_proxy        <string>     ED........ set HTTP proxy to tunnel through
  -headers           <string>     ED........ set custom HTTP headers, can override built in default headers
  -content_type      <string>     ED........ set a specific content type for the POST messages
  -user_agent        <string>     .D........ override User-Agent header (default "Lavf/58.45.100")
  -referer           <string>     .D........ override referer header
...

$

yt-dl has similar options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants