Wrong User Agent used for Thumbnail retrieval
Recently Ilive began checking the user agent on thumbnail requests, however Serviio uses the User-Agent: Java/1.7.0_04 when accessing thumbnails and so they fail.
Here is the wireshark for the serviio request:
and this is the wireshark for a successful browser request:
I need to be able to provide parameters for thumbnail accesses.
- Code:
2013-04-26 10:49:36,920 DEBUG [OnlineLibraryManager] Thumbnail http://static.ilive.to/images/channels/gz3d47y2phxi78x_snapshot.jpg not in cache yet, loading it
2013-04-26 10:49:37,040 WARN [FeedUpdaterThread] An error occured while retrieving thumbnail, will remove it from the item and will continue
org.serviio.library.online.CannotRetrieveThumbnailException: Failed to download thumbnail http://static.ilive.to/images/channels/gz3d47y2phxi78x_snapshot.jpg.
at org.serviio.library.online.OnlineLibraryManager.findThumbnail(OnlineLibraryManager.java:266)
at org.serviio.library.online.metadata.FeedUpdaterThread.run(FeedUpdaterThread.java:107)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://static.ilive.to/images/channels/gz3d47y2phxi78x_snapshot.jpg
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at org.serviio.util.HttpClient.retrieveBinaryFileFromURL(HttpClient.java:72)
at org.serviio.library.online.OnlineLibraryManager.findThumbnail(OnlineLibraryManager.java:258)
Here is the wireshark for the serviio request:
GET /images/channels/i6ultf8mp64grlx_snapshot.jpg HTTP/1.1
User-Agent: Java/1.7.0_04
Host: static.ilive.to
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
HTTP/1.1 403 Forbidden
Server: cloudflare-nginx
Date: Fri, 26 Apr 2013 15:21:01 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
and this is the wireshark for a successful browser request:
GET /images/channels/9ft15bx7kc229en_snapshot.jpg HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-US
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
Accept-Encoding: gzip, deflate
Host: static.ilive.to
Connection: Keep-Alive
HTTP/1.1 304 Not Modified
Server: cloudflare-nginx
Date: Fri, 26 Apr 2013 15:33:45 GMT
Connection: keep-alive
I need to be able to provide parameters for thumbnail accesses.