cairo-dock-team team mailing list archive
-
cairo-dock-team team
-
Mailing list archive
-
Message #04327
[Merge] lp:~mycompostpile/cairo-dock-plug-ins-extras/YoutubeDl into lp:cairo-dock-plug-ins-extras
Brian has proposed merging lp:~mycompostpile/cairo-dock-plug-ins-extras/YoutubeDl into lp:cairo-dock-plug-ins-extras.
Requested reviews:
Cairo-Dock Team (cairo-dock-team)
For more details, see:
https://code.launchpad.net/~mycompostpile/cairo-dock-plug-ins-extras/YoutubeDl/+merge/108440
Changed the notifications to use dialogues as the default instead of pynotify. User still has the option to use pynotify by changing under YoutubeDl configuration.
Removed the help menus. I haven't added the tooltips yet in the configuration file but will asap.
Changed the default video folder to use xdg-user-dir VIDEOS instead of the hard coded ~/Videos folder.
--
https://code.launchpad.net/~mycompostpile/cairo-dock-plug-ins-extras/YoutubeDl/+merge/108440
Your team Cairo-Dock Team is requested to review the proposed merge of lp:~mycompostpile/cairo-dock-plug-ins-extras/YoutubeDl into lp:cairo-dock-plug-ins-extras.
=== modified file 'YoutubeDl/Configuration.py' (properties changed: +x to -x)
=== modified file 'YoutubeDl/YoutubeDl'
--- YoutubeDl/YoutubeDl 2012-05-31 00:01:58 +0000
+++ YoutubeDl/YoutubeDl 2012-06-01 23:03:19 +0000
@@ -35,9 +35,6 @@
from constantTypes import PopupTypes
from constantTypes import menuEntries
-# import the help messages used in the right click context menu
-from helpInfo import helpMessages
-
class Applet(CDApplet):
def __init__(self):
@@ -135,20 +132,12 @@
return True
def reload(self):
- #"""
- #Je recharge la configuration si besoin.
- #"""
- #super(YoutubeDlPlugin, self).onReload(bConfigHasChanged)
- #if bConfigHasChanged:
- #self.__setConfiguration()
- #if self.__showStatusOnIcon:
- #self.icon.SetLabel(self.resultSummary)
- #if self.__showProgressOnIcon:
- #self.icon.SetQuickInfo(str(self.result[0]))
- #else:
- #self.icon.SetQuickInfo('')
+
if not self.__videos_directory:
- self.__videos_directory = os.path.abspath(os.path.expanduser("~")+"/Videos")
+ p = subprocess.Popen(["xdg-user-dir","VIDEOS"],stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=False)
+ directoryName, errors = p.communicate()
+ directoryName=directoryName.rstrip()
+ self.__videos_directory = os.path.abspath(directoryName)
if not self.__urlList_directory:
self.__urlList_directory = os.path.abspath('.')
if self.__showProgressOnIcon:
@@ -269,24 +258,6 @@
{"label": "Enable Downloading",
"icon" : "gtk-media-play",
"id" : menuEntries.enableDownload })
- items.append(
- {"type":1,
- "label": "Help Menu",
- "menu":0,
- "icon" : "gtk-help",
- "id" : menuEntries.helpSubMenu })
- items.append(
- {"type":0,
- "label": "youtube-dl Help",
- "menu":menuEntries.helpSubMenu,
- "icon" : "gtk-help",
- "id" : menuEntries.downloaderHelp })
- items.append(
- {"type":0,
- "label": "Applet Help",
- "menu": menuEntries.helpSubMenu,
- "icon" : "gtk-help",
- "id" : menuEntries.pluginHelp })
self.icon.AddMenuItems(items)
def on_menu_select(self,iNumEntry):
@@ -322,20 +293,6 @@
else:
self.result = ['Enabling','Enabling','Enabling','Enabling']
self.icon.SetQuickInfo(str(self.result[0]))
- elif iNumEntry == menuEntries.downloaderHelp:
- helpMessage = helpMessages.downloaderHelp
- self.icon.PopupDialog( {"message" :helpMessage,
- "buttons" : "ok",
- "icon" : "gtk-help"},
- {"visible" : True } )
- self.currentDialog = PopupTypes.infoDialog
- elif iNumEntry == menuEntries.pluginHelp:
- helpMessage = helpMessages.pluginHelp
- self.icon.PopupDialog( {"message" :helpMessage,
- "buttons" : "ok",
- "icon" : "gtk-help"},
- {"visible" : True } )
- self.currentDialog = PopupTypes.infoDialog
else:
self.messageDebug("An unknown menu entry was received")
=== modified file 'YoutubeDl/YoutubeDl.conf'
--- YoutubeDl/YoutubeDl.conf 2012-05-31 07:32:10 +0000
+++ YoutubeDl/YoutubeDl.conf 2012-06-01 23:03:19 +0000
@@ -138,7 +138,7 @@
showAlertAddURL = false
#b Attempt to use desktop notifications instead of dock messages? :
-usePynotify = true
+usePynotify = false
#X
myDummyFrame =
@@ -149,11 +149,11 @@
frame_folders=
#D Save videos to this directory:
-#{The path to save the videos to. Leave it empty to use the default one (currently in the users Videos directory).}
+#{The path to save the videos to. Leave it empty to use the default one (cuurently in the users Videos directory).}
videos_directory =
#D Save URL List to this directory:
-#{The path to save the URL list to. Leave it empty to use the default one (currently in the plugin directory).}
+#{The path to save the URL list to. Leave it empty to use the default one (cuurently in the plugin directory).}
urlList_directory =
[Download Options]
=== removed file 'YoutubeDl/helpInfo.py'
--- YoutubeDl/helpInfo.py 2012-05-31 00:01:58 +0000
+++ YoutubeDl/helpInfo.py 1970-01-01 00:00:00 +0000
@@ -1,70 +0,0 @@
-class helpMessages:
- downloaderHelp ="""Download videos from youtube.com or other video platforms
-
-DESCRIPTION
- Download videos from youtube.com or any other of the supported video platforms.
-
-Currently supported sites are: CollegeHumor, Comedy Central, Dailymotion,
-Facebook, Metacafe, MyVideo, Photobucket, The Escapist, Vimeo, Yahoo!, YouTube,
-blip.tv, depositfiles.com, video.google.com, xvideos, Soundcloud, InfoQ,
-Mixcloud, OpenClassRoom.
-
-Many YouTube.com videos are in Flash Video format and their extension would
-be "flv". Other videos are encoded in H.264 and these usually have the
-extension "mp4". In Linux and other unices, video players using a
-recent version of ffmpeg can play them. That includes MPlayer, VLC,
-xine, among others.
-
-OPTIONS
- Update: Update this program to the latest stable version.
- Ignore Errors: Ignore errors during download and continue processing.
- Username: Specify the youtube account username. Some videos require an
- account to be downloaded, mostly because they're flagged as mature
- content.
- Password: Like the username, specifies the account password.
- Format: Specify the video format (quality) in which to download the video.
- For youtube.com, in particular, the meaning of the format codes is
- given as:
- WebM video at 480p: 43
- WebM video at 720p: 45
- H264 video in MP4 container at 480p: 18
- H264 video in MP4 container at 720p: 22
- H264 video in MP4 container at 1080p: 37
- H264 video in FLV container at 360p: 34
- H264 video in FLV container at 480p: 35
- H263 video at 240p: 5
- 3GP video: 17
-
- Note that not all videos are available in all formats and that
- other sites supported by youtube-dl may have different conventions
- for their video formats.
- Max Quality: Limit the maximum quality of the videos to download.
- Title: Use the title of the video in the file name used to download the
- video.
- No Overwrites: Do no overwrite already existing files.
-
- Continue: Resume partially downloaded files.
-
-AUTHOR
- youtube-dl was written by Ricardo Garcia Gonzalez and many contributors
- from all around the internet.
-"""
-
- pluginHelp = """ Youtube Download Applet
-
-This applet allows a user to drag Youtube links from the Youtube website and
-drop them on the icon to download. The backend downloader is based on
-youtube-dl.py. If you have python-tk installed on your system saving and
-loading url lists will be done using a graphical dialog box, otherwise you
-need to set the directory path in the configuration and just enter the filename
-in the popup box. If you have pynotify installed on your system you have the
-option of letting the notification area of your desktop handle the alerts,
-otherwise alerts will be done using the cairo-dock popup messages. You can
-turn this feature on or off under the configuration. Currently the url list
-is not editable from the dock but if you save the list to a file you can edit
-with a text editor then load the list back into the plugin. Downloading can
-be paused from the context menu of the icon and you can choose to have
-downloads start automatically in the configuration area. The left click button
-on the mouse brings up the current url list and the middle button can be
-configured for different actions.
-"""
=== modified file 'YoutubeDl/myYoutubeDownloader.py'
--- YoutubeDl/myYoutubeDownloader.py 2012-05-31 00:01:58 +0000
+++ YoutubeDl/myYoutubeDownloader.py 2012-06-01 23:03:19 +0000
@@ -84,7 +84,11 @@
self.useTitle = self.__config.get('Download Options', 'useTitle')
if not videos_directory:
- videos_directory = os.path.abspath(os.path.expanduser("~")+"/Videos")
+ p = subprocess.Popen(["xdg-user-dir","VIDEOS"],stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=False)
+ directoryName, errors = p.communicate()
+ directoryName=directoryName.rstrip()
+ videos_directory = os.path.abspath(directoryName)
+
if not (videos_directory == os.path.abspath('.')):
os.chdir(videos_directory)
if doDebug:
Follow ups