![]() |
[RELEASE] Autoplay directory (script) - Printable Version Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151) ---- Thread: [RELEASE] Autoplay directory (script) (/showthread.php?tid=69797) Pages:
1
2
|
[RELEASE] Autoplay directory (script) - watchout - 2010-02-07 This simple script automatically plays all videofiles in a directory. The path of the directory can be set in the scriptfile. I was in need of such a script myself, so decided to learn some python and script it myself. The script also shuffles the order of the videos, so the order of the videofiles is different every time. (you can turn this option off by adding a # in front of the videoList.shuffle() command) It also puts all of your videos on repeat, so when the last video has been played; it starts over again. (turn this option off by adding a # in front of the xbmc.executebuiltin("xbmc.playercontrol(RepeatAll)") command) Very simple script, but I noticed some requests for a function like this in the past. Code: # Autoplay videodirectory Copy the above code, paste it in notepad and save it as autoplaydir.py (or something similar). Put the file in your xbmc/scripts/ directory. Add the script to your autoexec.py file to make it automatically play your videos at startup. Have fun with it ![]() - doestergaard - 2011-03-23 Can this be done, not at startup, but when I press play on a video? - kahn2k - 2011-11-21 I am running the OpenELEC 1.0.2 on my Asus Eee Box B202. I've tried the script but it doesn't seem to run. Can someone help me with this? Thanks! autoplaydir.py in \var\media\DATA\Download\WaitingRoom Code: # Autoplay videodirectory autoexec.py in \var\userdata\ Code: import xbmc - johnmerrick - 2011-11-21 this script is a great idea because there are some skins that don't play playlists automatically. they list them first. could this be added as a shortcut? RE: [RELEASE] Autoplay directory (script) - zeglute - 2012-10-27 This is EXACTLY what I need to do! Now, it seems like there is no autoexec.py anywhere on my system partition. How could i do it? I really need to be able to randomly play the videos on repeat, so it can play videos all day long in no particular order. Help me someone, please, I need this to be ready in 5 hours time... or less! thank you! RE: [RELEASE] Autoplay directory (script) - simon_kloyns - 2013-02-12 Hello! How hard is it to change your script to play a certain video_playlist.m3u ? RE: [RELEASE] Autoplay directory (script) - phig - 2013-02-18 (2013-02-12, 19:36)simon_kloyns Wrote: Hello! you just have to replace the loop listdir/for fname with videoList.load("/path/to/yourplaylist.m3u") RE: [RELEASE] Autoplay directory (script) - simon_kloyns - 2013-02-18 so true? Code: # Autoplay videodirectory Quote:I'm sorry for my English ! RE: [RELEASE] Autoplay directory (script) - simon_kloyns - 2013-03-03 Thank you! it works! RE: [RELEASE] Autoplay directory (script) - egeorge - 2013-03-08 I am having some trouble with this script. I am a competent Python guy and I found the documentation for the xbmc python module http://xbmc.sourceforge.net/python-docs/xbmc.html which definitely suggests that this script should work. However, I am getting an error like this: Code: Traceback (most recent call last): This suggests that the xbmc module has changed. I played around a little more and couldn't find *any* of the methods that I might need for this sort of script in my version of the python libs. I am using Frodo (12.0) running on openElec on a Raspberry Pi. I would appreciate any guidance on newer python docs, or a better approach for this. Thanks. RE: [RELEASE] Autoplay directory (script) - egeorge - 2013-03-08 After much digging, I determined the problem. I was attempting to run this from the command line, assuming that because the module "xbmc" imported ok, that these things were available. But it turns out you can *only* run this from the "internal" context. So now the script runs, and I get the infinite loop at startup. In my case, I just want to play a loop of videos in a particular directory, so I omitted the separate autoplaydir.py and simply made autoexec.py look like this: Code: import xbmc Thanks for the help in this thread. RE: [RELEASE] Autoplay directory (script) - dudumomo - 2013-12-03 Hi there, The script is working on Raspbmc but it doesn't repeat the videos tho... Any idea why? RE: [RELEASE] Autoplay directory (script) - carlox - 2014-09-30 Mostly for reference to new readers: (2013-12-03, 17:39)dudumomo Wrote: Hi there, You need to start the playback first, then set the RepeatAll, as no playlist is active before the directory has been queued. Maybe this is unique for Raspbmc, I don't know. Code: import xbmc Thanks for the tip though, just what I need for using Raspbmc for exhibits. RE: [RELEASE] Autoplay directory (script) - yvanof - 2014-10-13 Hi everybody, I use this script in Xbmc from Geexbox V3 (embed XBMC 11). Work fine, but playlist generated is shuffle, wether comment line #videoList.shuffle() Quote: for fname in dirList: Can i order a list by filename ? thx ! RE: [RELEASE] Autoplay directory (script) - yvanof - 2014-10-13 found solution: Quote:# Autoplay videodirectory |