plugin development - allow to specify referrer in ContentURLContainer

Create issue
Issue #962 new
Programmer created an issue

ContentURLContainer which is used for actual media download allows to specify user-agent but not the referrer, which is required for some sites like or Example of media URL: Referrer needed: Example batch file for ffmeg (note that batch is looking weird because of the difficulty to use \n as part of ffmpeg http header parameter)

setlocal EnableDelayedExpansion Set LF=^

for /f %%a in ('copy /z "%~f0" nul') do set "CR=%%a" set VIDEOURL= set REFERER= ffmpeg.exe -hide_banner -headers "Referer: %REFERER%!CR!!LF!" -user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36" -i "%VIDEOURL%" -y -b:a 320k -id3v2_version 3 -ac 1 -f mp3 out.mp3

Comments (4)

  1. Petr Nejedly repo owner

    it seems it's a pain to pass headers to ffmpeg currently, especially on Windows, as we need to add CRLF after each header.

    Postponing this until FFmpeg makes it easier.

  2. Kyan Beau

    This issue recently became a problem for me when one of my regularly watched online streams suddenly started requiring the Referer header. I was able to get ffmpeg to process it correctly by issuing the following command:

    ffmpeg.exe -headers "Referer:" -i ""

    The stream is from the following web page:

    I'm hoping that this information might be helpful to patch Serviio so it can work around this issue.

    My ffmpeg version is ffmpeg-20170111-e71b811-win64-static.

  3. Log in to comment