plugin development - allow to specify referrer in ContentURLContainer

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 http://www.radiotunes.com/ or http://www.di.fm/ Example of media URL: http://pub8.di.fm:80/di_vocaltrance_aacplus Referrer needed: http://www.di.fm 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=http://pub8.di.fm:80/di_vocaltrance_aacplus set REFERER=http://www.di.fm 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: http://www.adintrend.com/hd/live/iframe.php?ch=33&sid=aqr8acd73bbabf7cb6fc5f72dac2418dc2b&tmpx=" -i "http://a1.adintrend.com:443/live/ch33/i/ch33i.m3u8"

    The stream is from the following web page: http://www.adintrend.com/hd/ch33.

    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