I am having some problems scraping some HTML pages for media objects in my URL Service.
Most pages work fine, but sometimes the media server just gives up fetching media items.
The last thing I see in the logs each time it happens is:
2013-02-08 00:49:14,797 (-4faed000) : DEBUG (ServiceCode:22) - Calling MediaObjectsForURL…
2013-02-08 00:49:14,797 (-4faed000) : DEBUG (networking:166) - Requesting ‘http://channel9.msdn.com/Series/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-2-of-n’
2013-02-08 00:49:16,632 (-4faed000) : DEBUG (ServiceCode:29) - Found 2 videos
2013-02-08 00:49:16,633 (-4faed000) : DEBUG (ServiceCode:36) - Found an MP4
2013-02-08 00:49:16,634 (-4faed000) : WARNING (data:184) - Error decoding with simplejson, using demjson instead (this will cause a performance hit) - No JSON object could be decoded: line 1 column 0 (char 0)
2013-02-08 00:49:16,635 (-4faed000) : ERROR (localization:428) - Exception when trying to load en strings
2013-02-08 00:49:16,636 (-4faed000) : DEBUG (runtime:851) - Response: [200] MediaContainer, 15238 bytes
I can’t see any Python exceptions, etc so I’m a bit stuck where to investigate.
I’m not sure why it’s talking about JSON, localization, etc.
Any help greatly appreciated, thanks,
Charlie
Hello Charlie!
I’d have to see your code to be able to say anything about this. If you’re working on Channel9, there already is an existing URL Service for this website inside the Services bundle: https://github.com/plexinc-plugins/Services.bundle/tree/master/Contents/Service%20Sets/com.plexapp.plugins.channel9
Hi, thanks for the reply.
There’s already a URL Service for Channel9? I had completely missed that.
Is there already a channel for it that I missed too?
Presumably you need a dedicated channel for it, or how would the URL Service ever get used?
Or, does the URL Service also get called by the myPlex functionality?
Sorry, just trying to figure out why there would be a service if there isn’t a channel plugin for it.
So, can my channel plugin just use the existing URL Service directly or do I have to include it with my plugin?
BTW, I see you are parsing the duration caption. I found an attribute in the HTML that has the duration as “hh:mm:ss”
which I used as I thought it was less likely to break if they localised the caption string.
Also, the for the detailed video metadata such as nitrate, number of channels, codecs, etc. How did you get this?
Is it just a case of downloading a sample video and inspecting it? What happens if not all the videos are encoded the same way?
Sorry for the noob questions 
Thanks,
Charlie
I’ve attached my code if you should get a chance to try it out sometime.
It’s the “Most Viewed” and “Top Rated” pages that seem to cause the error, but I cannot see why.
Thanks,
Charlie
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.