- Timestamp:
- Apr 12, 2011, 8:57:45 PM (15 years ago)
- Location:
- ipk/source
- Files:
-
- 2 edited
- 2 moved
-
mediacenter_mediathek_2_8 (moved) (moved from ipk/source/mediacenter_mediathek_2_7 )
-
mediacenter_mediathek_2_8/usr/lib/enigma2/python/Plugins/Extensions/MultiMediathek/plugin.py (modified) (18 diffs)
-
swapmediacenter_mediathek_2_8 (moved) (moved from ipk/source/swapmediacenter_mediathek_2_7 )
-
swapmediacenter_mediathek_2_8/var/swap/extensions/MultiMediathek/plugin.py (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ipk/source/mediacenter_mediathek_2_8/usr/lib/enigma2/python/Plugins/Extensions/MultiMediathek/plugin.py
r7056 r7145 3 3 # Coded by Homey (c) 2011 4 4 # 5 # Version: 2. 75 # Version: 2.8.2 6 6 # Support: www.i-have-a-dreambox.com 7 7 ##################################################### … … 32 32 33 33 from enigma import ePicLoad, eTimer, getDesktop, eConsoleAppContainer, eBackgroundFileEraser, eServiceReference, iServiceInformation, iPlayableService 34 from os import stat as os_stat, listdir as os_listdir, path as os_path, system as os_system34 from os import stat as os_stat, listdir as os_listdir, path as os_path, readlink as os_readlink, system as os_system 35 35 from time import time 36 36 from twisted.web.client import getPage, downloadPage … … 58 58 config.plugins.multimediathek.imagecache = ConfigEnableDisable(default=True) 59 59 config.plugins.multimediathek.imagescaling = ConfigSelection(default="1", choices = [("0", _("simple")), ("1", _("better"))]) 60 config.plugins.multimediathek.imagescaler = ConfigSelection(default="0", choices = [("0", _("decodePic()")), ("1", _("getThumbnail()"))]) 60 61 config.plugins.multimediathek.showadultcontent = ConfigYesNo(default=False) 61 62 config.plugins.multimediathek.showsecretcontent = ConfigYesNo(default=False) 62 config.plugins.multimediathek.checkforupdate = ConfigYesNo(default=False) 63 config.plugins.multimediathek.version = NoSave(ConfigText(default="270")) 63 config.plugins.multimediathek.version = NoSave(ConfigText(default="282")) 64 65 default = config.plugins.multimediathek.storagepath.value + "/mediathek/movies" 66 tmp = config.movielist.videodirs.value 67 if default not in tmp: 68 tmp.append(default) 69 config.plugins.multimediathek.moviedir = ConfigSelection(default=default, choices=tmp) 64 70 65 71 ################################# … … 70 76 def __init__(self, toolbox, cmdline, filename, filetitle): 71 77 Job.__init__(self, _("Download Movie")) 78 self.filename = filename 72 79 self.toolbox = toolbox 73 80 self.retrycount = 0 … … 78 85 self.retrycount += 1 79 86 self.restart() 80 87 88 def cancel(self): 89 self.abort() 90 os_system("rm -f %s" % self.filename) 91 81 92 class downloadTask(Task): 82 93 ERROR_CORRUPT_FILE, ERROR_RTMP_ReadPacket, ERROR_SEGFAULT, ERROR_SERVER, ERROR_UNKNOWN = range(5) … … 246 257 self.textcolor = "#F7F7F7" 247 258 self.bgcolor = "#000000" 248 textsize = 20259 self.textsize = 20 249 260 250 261 # Create Thumblist … … 266 277 absY = self.spaceTop + self.spaceY + (posY*(self.spaceY + self.picY)) 267 278 self.positionlist.append((absX, absY)) 268 skincontent += "<widget source=\"label" + str(x) + "\" render=\"Label\" position=\"" + str(absX+2) + "," + str(absY+self.picY- textsize-10) + "\" size=\"" + str(self.picX - 10) + "," + str((textsize*2)+10) + "\" halign=\"center\" font=\"Regular;" + str(textsize) + "\" zPosition=\"4\" transparent=\"1\" foregroundColor=\"" + self.textcolor + "\" />"269 skincontent += "<widget name=\"thumb" + str(x) + "\" position=\"" + str(absX)+ "," + str(absY+5) + "\" size=\"" + str(self.picX -10) + "," + str(self.picY - ( textsize*2)) + "\" zPosition=\"4\" transparent=\"1\" alphatest=\"on\" />"279 skincontent += "<widget source=\"label" + str(x) + "\" render=\"Label\" position=\"" + str(absX+2) + "," + str(absY+self.picY-self.textsize-10) + "\" size=\"" + str(self.picX - 10) + "," + str((self.textsize*2)+10) + "\" halign=\"center\" font=\"Regular;" + str(self.textsize) + "\" zPosition=\"4\" transparent=\"1\" foregroundColor=\"" + self.textcolor + "\" />" 280 skincontent += "<widget name=\"thumb" + str(x) + "\" position=\"" + str(absX)+ "," + str(absY+5) + "\" size=\"" + str(self.picX -10) + "," + str(self.picY - (self.textsize*2)) + "\" zPosition=\"4\" transparent=\"1\" alphatest=\"on\" />" 270 281 271 282 # Screen, backgroundlabel and MovingPixmap … … 315 326 self.picload = ePicLoad() 316 327 self.picload.PictureData.get().append(self.showThumbPixmap) 317 self.picload.setPara((self.picX-10, self.picY-( textsize*2), sc[0], sc[1], config.plugins.multimediathek.imagecache.value, int(config.plugins.multimediathek.imagescaling.value), "#00000000"))328 self.picload.setPara((self.picX-10, self.picY-(self.textsize*2), sc[0], sc[1], config.plugins.multimediathek.imagecache.value, int(config.plugins.multimediathek.imagescaling.value), "#00000000")) 318 329 319 330 # Init eBackgroundFileEraser … … 321 332 322 333 # Check if plugin-update is available 323 if self.feedtitle == "Startseite" and config.plugins.multimediathek.checkforupdate.value:334 if self.feedtitle == "Startseite": 324 335 self.onLayoutFinish.append(self.checkforupdate) 325 336 … … 339 350 # Check if cache folder is on a mountable device and not inside flash-memory 340 351 tmppath = config.plugins.multimediathek.storagepath.value 341 while not os_path.ismount(tmppath): 342 tmppath = os_path.dirname(tmppath) 343 if tmppath == "/": 344 self["pageinfo"].setText(_("Error: Can not create cache-folders inside flash memory. Check your Cache-Folder Settings!")) 345 return False 352 if tmppath != "/tmp" and tmppath != "/media/ba": 353 if os_path.islink(tmppath): 354 tmppath = os_readlink(tmppath) 355 loopcount = 0 356 while not os_path.ismount(tmppath): 357 loopcount += 1 358 tmppath = os_path.dirname(tmppath) 359 if tmppath == "/" or tmppath == "" or loopcount > 50: 360 self["pageinfo"].setText(_("Error: Can not create cache-folders inside flash memory. Check your Cache-Folder Settings!")) 361 return False 346 362 347 363 # Create Cache Folders ... … … 399 415 getpageurl = unquote(tmpurls[1]) 400 416 self.postpageurl = unquote(tmpurls[0]) 401 getPage(getpageurl ).addCallback(self.ForwardExternalPage).addErrback(self.getxmlfeedError)417 getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalPage).addErrback(self.getxmlfeedError) 402 418 else: 403 419 getPage(feedurl).addCallback(self.gotxmlfeed).addErrback(self.getxmlfeedError) … … 409 425 def getxmlfeedError(self, error=""): 410 426 self["pageinfo"].setText("Error downloading XML Feed!\n\n" + str(error)) 411 427 print error 428 412 429 def gotxmlfeed(self, page=""): 430 print page 413 431 self["pageinfo"].setText("Parsing XML Feeds ...") 414 432 xml = parseString(page) … … 502 520 503 521 def gotThumbnail(self, data=""): 504 self.picload.startDecode(self.thumbfile) 505 522 if config.plugins.multimediathek.imagescaler.value == "0": 523 self.picload.startDecode(self.thumbfile) 524 elif self.picload.getThumbnail(self.thumbfile) == 1: 525 if self.thumbcount+1 < len(self.Thumbnaillist): 526 self.getThumbnail() 527 506 528 def showThumbPixmap(self, picInfo=None): 507 529 ptr = self.picload.getData() … … 698 720 config.mediaplayer.save() 699 721 700 self.moviefolder = config.plugins.multimediathek. storagepath.value+"/mediathek/movies"722 self.moviefolder = config.plugins.multimediathek.moviedir.value 701 723 self.imagefolder = config.plugins.multimediathek.storagepath.value+"/mediathek/images" 702 724 … … 744 766 getpageurl = unquote(tmpurls[1]) 745 767 self.postpageurl = unquote(tmpurls[0]) 746 getPage(getpageurl ).addCallback(self.ForwardExternalPage).addErrback(self.error)768 getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalPage).addErrback(self.error) 747 769 else: 748 770 getPage(self.url).addCallback(self.GotMovieInfo).addErrback(self.error) … … 790 812 getpageurl = tmpurls[1] 791 813 self.postpageurl = tmpurls[0] 792 getPage(getpageurl ).addCallback(self.ForwardExternalMovieList).addErrback(self.error)814 getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalMovieList).addErrback(self.error) 793 815 else: 794 816 getPage(self.movieinfo[1]).addCallback(self.GotMovieList).addErrback(self.error) … … 860 882 getpageurl = tmpurls[1] 861 883 self.postpageurl = tmpurls[0] 862 getPage(getpageurl ).addCallback(self.ForwardExternalMovieList).addErrback(self.error)884 getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalMovieList).addErrback(self.error) 863 885 return 864 886 … … 1331 1353 self.cfglist.append(getConfigListEntry(_("Thumbnail Caching:"), config.plugins.multimediathek.imagecache)) 1332 1354 self.cfglist.append(getConfigListEntry(_("Thumbnail Scaling Mode:"), config.plugins.multimediathek.imagescaling)) 1355 self.cfglist.append(getConfigListEntry(_("Thumbnail Scaler:"), config.plugins.multimediathek.imagescaler)) 1333 1356 self.cfglist.append(getConfigListEntry(_("Show Adult Content:"), config.plugins.multimediathek.showadultcontent)) 1334 1357 #self.cfglist.append(getConfigListEntry(_("Show Secret Content:"), config.plugins.multimediathek.showsecretcontent)) 1358 self.cfglist.append(getConfigListEntry(_("Download Directory:"), config.plugins.multimediathek.moviedir)) 1335 1359 self.cfglist.append(getConfigListEntry(_("Cache Folder:"), config.plugins.multimediathek.storagepath)) 1336 self.cfglist.append(getConfigListEntry(_("Check for updates:"), config.plugins.multimediathek.checkforupdate))1337 1360 ConfigListScreen.__init__(self, self.cfglist, session) 1338 1361 -
ipk/source/swapmediacenter_mediathek_2_8/var/swap/extensions/MultiMediathek/plugin.py
r7057 r7145 3 3 # Coded by Homey (c) 2011 4 4 # 5 # Version: 2. 75 # Version: 2.8.2 6 6 # Support: www.i-have-a-dreambox.com 7 7 ##################################################### … … 32 32 33 33 from enigma import ePicLoad, eTimer, getDesktop, eConsoleAppContainer, eBackgroundFileEraser, eServiceReference, iServiceInformation, iPlayableService 34 from os import stat as os_stat, listdir as os_listdir, path as os_path, system as os_system34 from os import stat as os_stat, listdir as os_listdir, path as os_path, readlink as os_readlink, system as os_system 35 35 from time import time 36 36 from twisted.web.client import getPage, downloadPage … … 58 58 config.plugins.multimediathek.imagecache = ConfigEnableDisable(default=True) 59 59 config.plugins.multimediathek.imagescaling = ConfigSelection(default="1", choices = [("0", _("simple")), ("1", _("better"))]) 60 config.plugins.multimediathek.imagescaler = ConfigSelection(default="0", choices = [("0", _("decodePic()")), ("1", _("getThumbnail()"))]) 60 61 config.plugins.multimediathek.showadultcontent = ConfigYesNo(default=False) 61 62 config.plugins.multimediathek.showsecretcontent = ConfigYesNo(default=False) 62 config.plugins.multimediathek.checkforupdate = ConfigYesNo(default=False) 63 config.plugins.multimediathek.version = NoSave(ConfigText(default="270")) 63 config.plugins.multimediathek.version = NoSave(ConfigText(default="282")) 64 65 default = config.plugins.multimediathek.storagepath.value + "/mediathek/movies" 66 tmp = config.movielist.videodirs.value 67 if default not in tmp: 68 tmp.append(default) 69 config.plugins.multimediathek.moviedir = ConfigSelection(default=default, choices=tmp) 64 70 65 71 ################################# … … 70 76 def __init__(self, toolbox, cmdline, filename, filetitle): 71 77 Job.__init__(self, _("Download Movie")) 78 self.filename = filename 72 79 self.toolbox = toolbox 73 80 self.retrycount = 0 … … 78 85 self.retrycount += 1 79 86 self.restart() 80 87 88 def cancel(self): 89 self.abort() 90 os_system("rm -f %s" % self.filename) 91 81 92 class downloadTask(Task): 82 93 ERROR_CORRUPT_FILE, ERROR_RTMP_ReadPacket, ERROR_SEGFAULT, ERROR_SERVER, ERROR_UNKNOWN = range(5) … … 246 257 self.textcolor = "#F7F7F7" 247 258 self.bgcolor = "#000000" 248 textsize = 20259 self.textsize = 20 249 260 250 261 # Create Thumblist … … 266 277 absY = self.spaceTop + self.spaceY + (posY*(self.spaceY + self.picY)) 267 278 self.positionlist.append((absX, absY)) 268 skincontent += "<widget source=\"label" + str(x) + "\" render=\"Label\" position=\"" + str(absX+2) + "," + str(absY+self.picY- textsize-10) + "\" size=\"" + str(self.picX - 10) + "," + str((textsize*2)+10) + "\" halign=\"center\" font=\"Regular;" + str(textsize) + "\" zPosition=\"4\" transparent=\"1\" foregroundColor=\"" + self.textcolor + "\" />"269 skincontent += "<widget name=\"thumb" + str(x) + "\" position=\"" + str(absX)+ "," + str(absY+5) + "\" size=\"" + str(self.picX -10) + "," + str(self.picY - ( textsize*2)) + "\" zPosition=\"4\" transparent=\"1\" alphatest=\"on\" />"279 skincontent += "<widget source=\"label" + str(x) + "\" render=\"Label\" position=\"" + str(absX+2) + "," + str(absY+self.picY-self.textsize-10) + "\" size=\"" + str(self.picX - 10) + "," + str((self.textsize*2)+10) + "\" halign=\"center\" font=\"Regular;" + str(self.textsize) + "\" zPosition=\"4\" transparent=\"1\" foregroundColor=\"" + self.textcolor + "\" />" 280 skincontent += "<widget name=\"thumb" + str(x) + "\" position=\"" + str(absX)+ "," + str(absY+5) + "\" size=\"" + str(self.picX -10) + "," + str(self.picY - (self.textsize*2)) + "\" zPosition=\"4\" transparent=\"1\" alphatest=\"on\" />" 270 281 271 282 # Screen, backgroundlabel and MovingPixmap … … 315 326 self.picload = ePicLoad() 316 327 self.picload.PictureData.get().append(self.showThumbPixmap) 317 self.picload.setPara((self.picX-10, self.picY-( textsize*2), sc[0], sc[1], config.plugins.multimediathek.imagecache.value, int(config.plugins.multimediathek.imagescaling.value), "#00000000"))328 self.picload.setPara((self.picX-10, self.picY-(self.textsize*2), sc[0], sc[1], config.plugins.multimediathek.imagecache.value, int(config.plugins.multimediathek.imagescaling.value), "#00000000")) 318 329 319 330 # Init eBackgroundFileEraser … … 321 332 322 333 # Check if plugin-update is available 323 if self.feedtitle == "Startseite" and config.plugins.multimediathek.checkforupdate.value:334 if self.feedtitle == "Startseite": 324 335 self.onLayoutFinish.append(self.checkforupdate) 325 336 … … 339 350 # Check if cache folder is on a mountable device and not inside flash-memory 340 351 tmppath = config.plugins.multimediathek.storagepath.value 341 while not os_path.ismount(tmppath): 342 tmppath = os_path.dirname(tmppath) 343 if tmppath == "/": 344 self["pageinfo"].setText(_("Error: Can not create cache-folders inside flash memory. Check your Cache-Folder Settings!")) 345 return False 352 if tmppath != "/tmp" and tmppath != "/media/ba": 353 if os_path.islink(tmppath): 354 tmppath = os_readlink(tmppath) 355 loopcount = 0 356 while not os_path.ismount(tmppath): 357 loopcount += 1 358 tmppath = os_path.dirname(tmppath) 359 if tmppath == "/" or tmppath == "" or loopcount > 50: 360 self["pageinfo"].setText(_("Error: Can not create cache-folders inside flash memory. Check your Cache-Folder Settings!")) 361 return False 346 362 347 363 # Create Cache Folders ... … … 399 415 getpageurl = unquote(tmpurls[1]) 400 416 self.postpageurl = unquote(tmpurls[0]) 401 getPage(getpageurl ).addCallback(self.ForwardExternalPage).addErrback(self.getxmlfeedError)417 getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalPage).addErrback(self.getxmlfeedError) 402 418 else: 403 419 getPage(feedurl).addCallback(self.gotxmlfeed).addErrback(self.getxmlfeedError) … … 409 425 def getxmlfeedError(self, error=""): 410 426 self["pageinfo"].setText("Error downloading XML Feed!\n\n" + str(error)) 411 427 print error 428 412 429 def gotxmlfeed(self, page=""): 430 print page 413 431 self["pageinfo"].setText("Parsing XML Feeds ...") 414 432 xml = parseString(page) … … 502 520 503 521 def gotThumbnail(self, data=""): 504 self.picload.startDecode(self.thumbfile) 505 522 if config.plugins.multimediathek.imagescaler.value == "0": 523 self.picload.startDecode(self.thumbfile) 524 elif self.picload.getThumbnail(self.thumbfile) == 1: 525 if self.thumbcount+1 < len(self.Thumbnaillist): 526 self.getThumbnail() 527 506 528 def showThumbPixmap(self, picInfo=None): 507 529 ptr = self.picload.getData() … … 698 720 config.mediaplayer.save() 699 721 700 self.moviefolder = config.plugins.multimediathek. storagepath.value+"/mediathek/movies"722 self.moviefolder = config.plugins.multimediathek.moviedir.value 701 723 self.imagefolder = config.plugins.multimediathek.storagepath.value+"/mediathek/images" 702 724 … … 744 766 getpageurl = unquote(tmpurls[1]) 745 767 self.postpageurl = unquote(tmpurls[0]) 746 getPage(getpageurl ).addCallback(self.ForwardExternalPage).addErrback(self.error)768 getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalPage).addErrback(self.error) 747 769 else: 748 770 getPage(self.url).addCallback(self.GotMovieInfo).addErrback(self.error) … … 790 812 getpageurl = tmpurls[1] 791 813 self.postpageurl = tmpurls[0] 792 getPage(getpageurl ).addCallback(self.ForwardExternalMovieList).addErrback(self.error)814 getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalMovieList).addErrback(self.error) 793 815 else: 794 816 getPage(self.movieinfo[1]).addCallback(self.GotMovieList).addErrback(self.error) … … 860 882 getpageurl = tmpurls[1] 861 883 self.postpageurl = tmpurls[0] 862 getPage(getpageurl ).addCallback(self.ForwardExternalMovieList).addErrback(self.error)884 getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalMovieList).addErrback(self.error) 863 885 return 864 886 … … 1331 1353 self.cfglist.append(getConfigListEntry(_("Thumbnail Caching:"), config.plugins.multimediathek.imagecache)) 1332 1354 self.cfglist.append(getConfigListEntry(_("Thumbnail Scaling Mode:"), config.plugins.multimediathek.imagescaling)) 1355 self.cfglist.append(getConfigListEntry(_("Thumbnail Scaler:"), config.plugins.multimediathek.imagescaler)) 1333 1356 self.cfglist.append(getConfigListEntry(_("Show Adult Content:"), config.plugins.multimediathek.showadultcontent)) 1334 1357 #self.cfglist.append(getConfigListEntry(_("Show Secret Content:"), config.plugins.multimediathek.showsecretcontent)) 1358 self.cfglist.append(getConfigListEntry(_("Download Directory:"), config.plugins.multimediathek.moviedir)) 1335 1359 self.cfglist.append(getConfigListEntry(_("Cache Folder:"), config.plugins.multimediathek.storagepath)) 1336 self.cfglist.append(getConfigListEntry(_("Check for updates:"), config.plugins.multimediathek.checkforupdate))1337 1360 ConfigListScreen.__init__(self, self.cfglist, session) 1338 1361
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/openaaf/chrome/common/titannit_trac_banner.png)