Page 1 of 1
[SOLVED] Series folder empty

Posted:
Thu Sep 20, 2012 7:33 am
by margus
I installed the newer version of Serviio and noticed that it doesn't recognize series and put them in series folder. All the other folders (sorting movies by producers, actors and whatnot) are ok. I uninstalled it and installed the older version and everything was ok again.
Re: Series folder empty

Posted:
Thu Sep 20, 2012 9:25 pm
by zip
there should not be any difference between the two versions in this regard. You could check
detailed log from the 1.0.1 version to check if it found the online metadata - might have been a problem with the online service when you ran the scan.
Re: Series folder empty

Posted:
Sun Sep 23, 2012 2:44 pm
by lobster
this happens because the owner of thetvdb.com has implemented a browser check feature on the site. When serviio tries to fetch online metadata it sends (in my case) "User-Agent: Java/1.6.0_31" header and site replies with 403 Forbidden. Dear Petr, could you please change the header to some of well-known browser identificators or let us to do this ourselfs in java properties. Thanks in advance.
Re: Series folder empty

Posted:
Sun Sep 23, 2012 5:20 pm
by zip
Do you have any source for this claim? It works for me and I doubt they would do a browser check for public API,which is supposed to be used mainly outside a browser.
Re: Series folder empty

Posted:
Sun Sep 23, 2012 5:59 pm
by lobster
Yes, I've tried to catch traffic to thetvdb.com via tcpdump. Result is attached.
Cut of the logfile:
2012-09-23 18:03:58,851 WARN [LibraryManager] Cannot read metadata of file /mnt/storage/video/Торренты/Активные/Alphas.S02E08.rus.LostFilm.TV.avi via extractor ONLINE_VIDEO_SOURCES. Message: Cannot retrieve episode details (series = 210841, season = 2, episode = 8): Server returned HTTP response code: 403 for URL:
http://thetvdb.com/api/235C8CA4529142E9 ... 2/8/ru.xmlAlso I've tried to replay this issue manually. I've used lynx to introduce a request with the default User-Agent and with Java/1.6.0_31. Very interesting things. The default requests in series return correct response. But requests with custom User-Agent return 403 Forbidden on second and following iterations.
Sample requests where:
default: lynx
http://thetvdb.com/api/235C8CA4529142E9 ... 2/8/ru.xmlcustom: lynx -useragent="Java/1.6.0_31"
http://thetvdb.com/api/235C8CA4529142E9 ... 2/8/ru.xmlSo for me it means some kind of restriction technique, but probably works just for my IP address (Russian IP block). I'm using Serviio v.1.0.1 and didn't ever use the older versions.
Re: Series folder empty

Posted:
Sun Sep 23, 2012 7:52 pm
by skajfes
I knew I am not crazy. The same thing happens to me. I've reported a bug on bitbucket and it is being resolved. :thumbsup:
It is really strange that they are putting a request filter by user agent on an API
FWIW I've noticed an inconsistency in the API. On the one hand it always works when I open one of the metadata links in browser or with curl using one of the standard user agent strings. On the other hand when I try to curl with Java/1.6.0_23 user agent string it sometimes fails and sometimes it works.
Re: Series folder empty

Posted:
Mon Sep 24, 2012 8:22 am
by lobster
Just executed some tests. Requests with "Java" user-agent to php script need approx. 2 seconds to be unbaned, but requests to .xml file need more (didn't measure exact time). So, when file is adding to library there are 2 requests (1st - get xml path, 2nd - retrieve xml info). In this case while executed in series 2nd request fails 'cause 2 sec interval didn't meet. And subsequent requests also fail, 'cause there more time to be unbaned after failed xml request. IMHO.
Re: Series folder empty

Posted:
Mon Sep 24, 2012 11:26 am
by zip
Do you see the same behaviour with a 'Mozilla' user agent?
Re: Series folder empty

Posted:
Mon Sep 24, 2012 1:21 pm
by lobster
No. The use of -useragent="Mozilla" doesn't reproduce this error. Tried 8 subsequent requests to different URLs in 5 secs - all was successful. But, for example, -useragent="MSIE" fails.
Re: Series folder empty

Posted:
Sun Sep 30, 2012 2:13 pm
by lobster
Well, for now the problem has gone and I can see all series again! It seems that the content owner fixed his filter on browser ID.
I hope that such a problem will not repeat and annoy again )) And thanks for fix to all of you.
Re: Series folder empty

Posted:
Mon Oct 01, 2012 4:00 pm
by zip
thanks for letting us know, I'll close the ticket