Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. import os
  4. import xbmc
  5. import xbmcaddon
  6. import xbmcgui,xbmcvfs
  7. import time
  8. import re
  9. import YDStreamUtils
  10. import YDStreamExtractor
  11.  
  12. addon = xbmcaddon.Addon()
  13.  
  14. addonname = addon.getAddonInfo('name')
  15.  
  16. folder = xbmcaddon.Addon(id='script.module.youtube.dl')
  17.  
  18. savepath = folder.getSetting('last_download_path').decode('utf-8')
  19.  
  20. path = xbmc.getInfoLabel('ListItem.FileNameAndPath')
  21. title = xbmc.getInfoLabel('ListItem.Title')
  22. listitem = xbmcgui.ListItem(path=path)
  23. listitem.setInfo(type="Video", infoLabels={"Title": title})
  24.  
  25. kodi_player = xbmc.Player()
  26. kodi_player.play(path,listitem)
  27.  
  28. time.sleep(10)
  29. videoda=0
  30.  
  31. while videoda==0 :
  32. try:
  33. file=kodi_player.getPlayingFile()
  34. if not file=="":
  35. videoda=1
  36. except:
  37. pass
  38.  
  39. file=file.split("|")[0]
  40.  
  41. try:
  42. ### set custom filename / outputname from listitem here - but how? ###
  43. info = YDStreamExtractor.getVideoInfo(file)
  44. YDStreamExtractor.handleDownload(info, bg=True)
  45. except:
  46. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement