Browse Source

PlayerComponent: use suggested user-agent when accessing media URL

Some channels require this.

Needs the appropriate web-client change to actually work.

Fixes #252.
Vincent Lang 9 years ago
parent
commit
053c5e73ff
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/player/PlayerComponent.cpp

+ 4 - 0
src/player/PlayerComponent.cpp

@@ -251,6 +251,10 @@ void PlayerComponent::queueMedia(const QString& url, const QVariantMap& options,
 
   extraArgs.insert("pause", options["autoplay"].toBool() ? "no" : "yes");
 
+  QString userAgent = metadata["headers"].toMap()["User-Agent"].toString();
+  if (userAgent.size())
+    extraArgs.insert("user-agent", userAgent);
+
   command << extraArgs;
 
   QLOG_DEBUG() << command;