Continuous stream from ampache to stdout #8613

Closed
opened 2026-02-21 04:27:06 -05:00 by deekerman · 7 comments
Owner

Originally created by @robsdedude on GitHub (Aug 31, 2016).

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.08.31. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2016.08.31

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

My problem

I'm trying to open a stream (they call it channels) from my ampache server. If you do

curl https://music.example.org/channel/2/stream.mp3 | vlc -

This works great. But if I try to do it with youtube-dl like this

youtube-dl -v -o - "https://music.example.org/channel/2/stream.mp3" | vlc -

VLC opens but doesn't play the stream. The generic stream handler seems not to be able to open a simple stream. You can find the Output of -v below. Nothing else comes after that output. youtube-dl just gets stuck.

Now the most simple solution would be just to use curl. But it would be great if I could just use one program for all kind of input.


Output of -v

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

youtube-dl -v -o - "https://music.example.org/channel/2/stream.mp3"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'-o', u'-', u'https://music.example.org/channel/2/stream.mp3']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.08.31
[debug] Python version 2.7.6 - Linux-3.13.0-37-generic-x86_64-with-LinuxMint-17.1-rebecca
[debug] exe versions: ffmpeg N-79299-g15fa017, ffprobe N-79299-g15fa017
[debug] Proxy map: {}
[generic] stream: Requesting header
Originally created by @robsdedude on GitHub (Aug 31, 2016). ### Make sure you are using the _latest_ version: run `youtube-dl --version` and ensure your version is _2016.08.31_. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected. - [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.08.31** ### Before submitting an _issue_ make sure you have: - [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections - [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones ### What is the purpose of your _issue_? - [ ] Bug report (encountered problems with youtube-dl) - [ ] Site support request (request for adding support for a new site) - [x] Feature request (request for a new functionality) - [ ] Question - [ ] Other --- ### My problem I'm trying to open a stream (they call it channels) from my ampache server. If you do ``` curl https://music.example.org/channel/2/stream.mp3 | vlc - ``` This works great. But if I try to do it with youtube-dl like this ``` youtube-dl -v -o - "https://music.example.org/channel/2/stream.mp3" | vlc - ``` VLC opens but doesn't play the stream. The generic stream handler seems not to be able to open a simple stream. You can find the Output of `-v` below. Nothing else comes after that output. youtube-dl just gets stuck. Now the most simple solution would be just to use curl. But it would be great if I could just use one program for all kind of input. --- ### Output of `-v` Add `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```): ``` youtube-dl -v -o - "https://music.example.org/channel/2/stream.mp3" [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v', u'-o', u'-', u'https://music.example.org/channel/2/stream.mp3'] [debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2016.08.31 [debug] Python version 2.7.6 - Linux-3.13.0-37-generic-x86_64-with-LinuxMint-17.1-rebecca [debug] exe versions: ffmpeg N-79299-g15fa017, ffprobe N-79299-g15fa017 [debug] Proxy map: {} [generic] stream: Requesting header ```
deekerman 2026-02-21 04:27:06 -05:00
Author
Owner

@dstftw commented on GitHub (Aug 31, 2016):

Both does not work for me:

HTTP request sent, awaiting response... 502 Bad Gateway

@dstftw commented on GitHub (Aug 31, 2016): Both does not work for me: > HTTP request sent, awaiting response... 502 Bad Gateway
Author
Owner

@robsdedude commented on GitHub (Aug 31, 2016):

Yeah... That's because I had turned off the channel. And I replaced my domain with example.org (just forgot one instance) so it wasn't to expect that the stream works. I did this because I do not have permissions to stream that music in public. Here is a test stream, that streams one song (under cc license) in a loop:

https://music.xia.de/channel/3/stream.mp3

@robsdedude commented on GitHub (Aug 31, 2016): Yeah... That's because I had turned off the channel. And I replaced my domain with `example.org` (just forgot one instance) so it wasn't to expect that the stream works. I did this because I do not have permissions to stream that music in public. Here is a test stream, that streams one song (under cc license) in a loop: https://music.xia.de/channel/3/stream.mp3
Author
Owner

@dstftw commented on GitHub (Sep 3, 2016):

That is because your webserver simply does not respond to HEAD requests. Fix your server or use smaller timeout with --socket-timeout.

@dstftw commented on GitHub (Sep 3, 2016): That is because your webserver simply does not respond to HEAD requests. Fix your server or use smaller timeout with `--socket-timeout`.
Author
Owner

@robsdedude commented on GitHub (Oct 8, 2016):

I thought about it again. Why isn't socket timeout a default value? I mean why would you want your program to get stuck just because a server isn't reacting properly?

@robsdedude commented on GitHub (Oct 8, 2016): I thought about it again. Why isn't socket timeout a default value? I mean why would you want your program to get stuck just because a server isn't reacting properly?
Author
Owner

@yan12125 commented on GitHub (Oct 9, 2016):

@roba91 FYI: There's an option --socket-timeout, whose default is 600 seconds.

@yan12125 commented on GitHub (Oct 9, 2016): @roba91 FYI: There's an option `--socket-timeout`, whose default is 600 seconds.
Author
Owner

@robsdedude commented on GitHub (Oct 9, 2016):

I knew about that option. However, I didn't know it has a default value. But is waiting for 10 minutes a reasonable default? I mean if the server can't make it to send back a response within the first , I don't know, about 10 seconds or so it will probably it will most probably don't send back a response at all.

@robsdedude commented on GitHub (Oct 9, 2016): I knew about that option. However, I didn't know it has a default value. But is waiting for 10 minutes a reasonable default? I mean if the server can't make it to send back a response within the first , I don't know, about 10 seconds or so it will probably it will most probably don't send back a response at all.
Author
Owner

@yan12125 commented on GitHub (Oct 9, 2016):

The value was changed from 20 seconds to 10 minutes as the original value was too short for some people (#1862). And in my experience some Chinese websites give no response within a minute, thanks to the Great FireWall. If you're sure your network is quite stable, you can put your favorite value in configuration files.

@yan12125 commented on GitHub (Oct 9, 2016): The value was changed from 20 seconds to 10 minutes as the original value was too short for some people (#1862). And in my experience some Chinese websites give no response within a minute, _thanks to the Great FireWall_. If you're sure your network is quite stable, you can put your favorite value in [configuration files](https://github.com/rg3/youtube-dl/blob/master/README.md#configuration).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#8613
No description provided.