| 645 | |
| 646 | |
| 647 | def decryptContainer(self, plugin, url): |
| 648 | data = [] |
| 649 | # only works on container plugins |
| 650 | |
| 651 | self.m.log.debug("Pre decrypting %s with %s" % (url, plugin)) |
| 652 | |
| 653 | # dummy pyfile |
| 654 | pyfile = PyFile(self.m.core.files, -1, url, url, 0, 0, "", plugin, -1, -1) |
| 655 | |
| 656 | pyfile.initPlugin() |
| 657 | |
| 658 | # little plugin lifecycle |
| 659 | try: |
| 660 | pyfile.plugin.setup() |
| 661 | pyfile.plugin.loadToDisk() |
| 662 | pyfile.plugin.decrypt(pyfile) |
| 663 | pyfile.plugin.deleteTmp() |
| 664 | |
| 665 | for pack in pyfile.plugin.packages: |
| 666 | pyfile.plugin.urls.extend(pack[1]) |
| 667 | |
| 668 | data = self.m.core.pluginManager.parseUrls(pyfile.plugin.urls) |
| 669 | |
| 670 | self.m.log.debug("Got %d links." % len(data)) |
| 671 | |
| 672 | except Exception, e: |
| 673 | self.m.log.debug("Pre decrypting error: %s" % str(e)) |
| 674 | finally: |
| 675 | pyfile.release() |
| 676 | |
| 677 | return data |