Menu

#742 pass referrer/user-agent/http-header-fields/cookies-file command line parameters to the player

Next_Release
open
nobody
None
5
2020-01-08
2019-09-03
koko
No

mplayer supports:

-referrer <string>
-user-agent <string>
-http-header-fields <field1,field2>
-cookies-file <filename>

mpv supports:

--referrer=<string>
--user-agent=<string>
--http-header-fields=<field1,field2>
--cookies-file=<filename>

(actually mpv has no problem with mplayer format of those parameters, --referrer="someserver.com" works as wel as -referrer someserver.com)

sadly there is no way of passing those parameters thru smplayer :(
I even tried some workarounds, like setting smplayer advanced/options "--referrer=%var%" and trying to pass command line local/global variables with SET XYZ=someserver.com SETX XYZ someserver.com, but that doesnt work, %var% is passed as string without being evaluated.
Best I can come up with is replacing mplayer.exe mpv.exe with my own shim autohotkey executable and stealthy injecting parameters this way, but its very messy.

Worst case scenario dirty easy workaround would be making smplayer pass all parameters it cant recognize to the underlying player, so
smplayer.exe "https://someserver.com/123.mp4" --referer="someserver.com"
would call
mvp *bunch of stuff normally passed* --referer="someserver.com"

Best case scenario would be mapping those 4 input parameters to the player versions.

Discussion

  • koko

    koko - 2020-01-07

    actually https://www.smplayer.info/forum/viewtopic.php?f=2&t=8105 sounds even better, because cmplayer is also missing ability to pass separate audio stream URL. Being able to pass arbitrary parameters to underlying player would solve that.

     
  • Ricardo Villalba

    SMPlayer supports the options #EXTVLCOPT:http-referrer and #EXTVLCOPT:http-user-agent in m3u files to pass the referrer and user agent.

     
  • koko

    koko - 2020-01-08

    I looked some more in the source code and found a hacky workaround that almost works for me. I can use sed.exe to edit smplayer.ini: mplayer_additional_options="" every single time before starting smplayer.exe :o) Sadly this only works once, smplayer doesnt reread smplayer.ini every time, even if timestamp updated. Edit: hmm, I could manually kill smplayer.exe every time, yes that would work :P
    As you can tell Im trying all the lazy solutions first :)

     

    Last edit: koko 2020-01-08

Log in to post a comment.