Unable to subscribe to manually entered feed

Bug #1626501 reported by Martin Wimpress 
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
podbird
Triaged
High
Unassigned

Bug Description

I am unable to subscribe to Linux Weekly Daily Wednesday podcast or mintCast by manually entering the following feed URLs:

  * https://linuxgamecast.com/feed/lwdwmp3/
  * https://mintcast.org/category/mp3/feed/

Tags: parser
Revision history for this message
Fred Vkigg (fvkigg) wrote :

I thought I take a look at this now that I have a working Ubuntu SDK!

https://linuxgamecast.com/feed/lwdwmp3/ is returning 406 'Not acceptable' to the XMLHttpRequest GET. Looks like it is expecting a specific header!

Revision history for this message
Fred Vkigg (fvkigg) wrote :

https://mintcast.org/category/mp3/feed/ seems to be returning status 0 which is totally bazaar!

Revision history for this message
Fred Vkigg (fvkigg) wrote :

Try to work around the problem setting a number of headers in the XMLHttpRequest for example:

        xhr.setRequestHeader("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0");
        xhr.setRequestHeader("Accept", "application/rss+xml, text/xml;q=0.5, */*;q=0.1");
        xhr.setRequestHeader("Accept-Language", "de-DE,en;q=0.5");
        xhr.setRequestHeader("Accept-Encoding", "gzip, deflate, br");

But no luck still getting a 406.

Conversely use a heap of empty headers with wget still results in a response from this server: For example:
 wget --header='User-Agent: ' --header='Accept: ' --header='Accept-Language: en' --header='Accept-Encoding: ' --save-headers https://linuxgamecast.com/feed/lwdwmp3/

All very strange!

Revision history for this message
Fred Vkigg (fvkigg) wrote :

Useing Wireshark I can see the problem. Both XMLHttpRequest and wget do not allow you to change the User-Agent by simply setting the header with that name.
Wireshark shows that QT's XMLHttpRequest is using 'User-Agent: Mozilla/5.0'. The https://linuxgamecast.com/feed/lwdwmp3/ site is explicitly no accepting this (lovely)! This can be reproduced with:
wget --user-agent=Mozilla/5.0 https://linuxgamecast.com/feed/lwdwmp3/

One workaround would be to set a more 'acceptable' User-Agent. What that would be for all sites is anyones guess! The User-Agent cannot be set directly in 'XMLHttpRequest' see:
  https://bugreports.qt.io/browse/QTBUG-20473

This mentions: Implementing a custom QNetworkAccessManager and setting the header there solves the problem

Revision history for this message
Fred Vkigg (fvkigg) wrote :

As a non QML Programmer my guess this should be done in the MainView Component.onCompleted method.
Anyone know how to get hold the QApplication instance in there?

This is needed in order to override 'QNetworkAccessManagerFactory. One other possibility is set the ApplicationName on ApplicationVersion Strings.
See https://wiki.qt.io/How_to_set_user_agent_in_Qt_application

tags: added: parser
Changed in podbird:
importance: Undecided → High
status: New → Triaged
Changed in podbird:
milestone: none → 0.9
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.