Yes - that seems to be it working. Many thanks for your help Billy Joe. I thought the headers (in particular the user-agent) were set in the site configuration, but obviously not.
Can you get this submitted to the app store as an update?
here this should be good now
Nice one - sorry, I posted at the same time as you. Do you know if there’s a way to suppress Plex from updating the plug-in (i.e., reverting it) until this is approved for release from the app store?
headers for the webvideoitems can be set in the siteconfig, any http requests in the python can have the headers set in the python
HEADERS = {"User-agent" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20091218 Firefox 3.6", "Accept-encoding" : "gzip"}<br />
<br />
XML.ElementFromURL(URL_PROGS, isHTML=True, headers=HEADERS)
Traceback (most recent call last):
File “/Users/billyjoe/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/1/Python/PMS/Plugin.py”, line 640, in __call
return function(*args, **kwargs)
File “/Users/billyjoe/Library/Application Support/Plex Media Server/Plug-ins/4oD.bundle/Contents/Code/init.py”, line 33, in UpdateCache
fsets = XML.ElementFromURL(URL_ROOT, isHTML=True, headers=HEADERS, cacheTime=CACHE_1HOUR).xpath("//li[@class=‘fourOnDemandSet’]")
AttributeError: ‘str’ object has no attribute ‘xpath’
got that partway through its downloading/precaching thingy
suive, is it working 100% for you? also to prevent the appstore from overwriting it you add
<key>PlexPluginDevMode</key><br />
<string>1</string>
to the plugin's info.plist
After removing the 4od data folder and restarting Plex it updated the cache properly - no errors, all programs complete. So the scraping definitely worked 100%.
However, it looks like the site configuration is broken - I wasn’t able to play any shows. I just got a placeholder with “Click here to play…”.
I think in the time since the scraping broke the player has been changed because the .swf filename on the site doesn’t match the one in the site configuration. If I get a bit of time I’ll play around with this over the weekend. It’s a bit of a struggle for me to troubleshoot as I have to sit right in front of our main TV to do so. Need to get my hands on a Macbook badly…
Yeah I get the same thing, I have changed the swf name in site config, but didn't seem to fix it. you should turn on vnc on your mac mini so that you can control it from elsewhere. Hopefully I will find some time on the weekend to take a look at this, seem that it is close to working again.
Sander fixed the siteconfig, it should be on the store soon-ish, when it is make sure to remove PlexPluginDevMode if you had added it or the plugin wont update.
The version that was added to the AppStore is broken. I got the update on Wednesday night and the site configuration seems fine because the previously cached shows worked fine. Updates weren’t working though so I did a complete reinstall removing the data folder.
The result of the updatecache function is a traceback that leads back to the array “substitutions” being undefined. So I went to have a look and it turns out that Substitutions.json hasn’t been included in the bundle!
Does anyone have a copy of it saved somewhere? And if you do can you resubmit the bundle to the AppStore with it included?
Cheers!
Nice catch! I completely overlooked that! I'll ask around if someone still has a copy of Substitutions.json (it's not in the plugin git repo :()
Any joy in finding this? Where’s the git repo for it?
Cheers.
I have attached the missing file. I have restored this from time machine from 8th of March. Hope that helps.
Thanks 41John!
I also found the file in an older version of the plugin. I added the file, the changed init.py from Billy Joe and my own changes in the Site Config file, but I still can’t get this plugin to work. Attached to this post the latest version with all those changes.
The problem now seems to be the default dictionary is empty. Sander - can you check the old version you have and see if the default dictionary is populated? The updatecache code seems to expect to find some keypairs there (first one is genres and this is where the function fails).
Cheers.
Here is an old copy of the Dictionary file. Seems that the new version was missing a lot of things.
Nice one John!! This seems to fix everything! The first time I started PMS after changing the file, the plugin started to collect data immediately. I've created a [Lighthouse ticket](https://plexapp.lighthouseapp.com/projects/31804/tickets/435-4od) with the update and asked Isaac to push it to the Store.
Thanks for your work on this, John! You've made a lot of people very happy :)
was the update plugin given the access cookie for adult shows? The 4od app works great now but I can’t watch shows like peep show - all I get is a blank screen
An updated site config has been added to the bundle and the update should be available in the App Store.
**If the update doesn't work for you**, please remove the plugin manually before reinstalling it. You can do this by removing *4oD.bundle* from *~/Library/Application Support/Plex Media Server/Plugins*
For me 4OD is still not working properly despite being a new user and installing the 4OD plugin on the 26th April. All I get is the shows in date order, none of the other areas work like shows by genre, top shows and basically all the other options. So 90% of the functionality is not there. Any ideas? Do I need to manually install those zipped up files earlier in the discussion? I tried doing the above 2 or 3 times but that did not help?