Is it possible to load third party libraries?

I copied over beautifulsoup and tried to import it, but it fails in an odd way. I guess it’s not a show-stopper if it’s not allowed, I can still use the dumb client model where the plugin just interfaces with a server that’s loaded separately and does all the actual work.

Here’s the crash log:
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-7caf41d\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\core.py”, line 608, in start
self.sandbox.execute(self.init_code)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-7caf41d\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py”, line 256, in execute
exec(code) in self.environment
File “C:\Users\User\AppData\Local\Plex Media Server\Plug-ins est.bundle\Contents\Code_init_.py”, line 20, in
import bs4
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-7caf41d\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py”, line 333, in import
return mod.load_module(_name)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-7caf41d\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py”, line 44, in load_module
module = RestrictedModule(name, path, sandbox)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-7caf41d\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\loader.py”, line 20, in init
code = sandbox._core.loader.load(filename, sandbox.policy.elevated_execution)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-7caf41d\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\loader.py”, line 47, in load
code = self.compile(str(source), str(uni(filename)), elevated)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-7caf41d\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\loader.py”, line 52, in compile
return RestrictedPython.compile_restricted(source, name, ‘exec’, elevated=elevated)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-7caf41d\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 115, in compile_restricted
gen.compile()
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-7caf41d\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 68, in compile
tree = self._get_tree()
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-7caf41d\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 62, in get_tree
raise SyntaxError, self.rm.errors[0]
SyntaxError: Line 19: “author” is an invalid variable name because it starts with "
"

Sorry, seems like I just need to move dependencies to Libraries\Shared and give the plugin elevated privileges in Info.plist:
PlexPluginCodePolicyElevated

BeautifulSoup is already part of PMS!

Simply use the following:

from BeautifulSoup import BeautifulSoup

See my SRT2UTF-8 plugin for more details

/T