• 1
  • 2(current)
  • 3
  • 4
  • 5
  • 9
Release Play Random Videos - context item and script
#16
(2016-04-02, 00:43)rmrector Wrote: There currently isn't a way to play more than one video at a time with the context item.

For the next update I will add a few options for setting number of videos to play to the add-on settings. I'll also look into a way to play through all selected videos like party mode. It may be a month before I get back to Kodi stuff, so the next update won't be quite so quick.

Hey man, I've gotten by for so many years without this, I think I can handle waiting another month. Smile

Your work is greatly appreciated!!
Reply
#17
Hi man

I try to configure this Play Random Video but is not working everytime that i go to the plugin is says "See README file"... can you please explain better how to use this script?
Installed
Edit the file with the path end so on
Then?
Why is it not staring?
Reply
#18
(2016-04-28, 10:37)patrickGE Wrote: Hi man

I try to configure this Play Random Video but is not working everytime that i go to the plugin is says "See README file"... can you please explain better how to use this script?
Installed
Edit the file with the path end so on
Then?
Why is it not staring?

Install the "Context menus" add-on Play Random Video from the official Kodi Add-on repository, then highlight a TV show in your library and open the context menu, towards the bottom there will be a "Play Random" button that will play a random episode from that TV show; it works the same for other supported lists or collections of videos.
Reply
#19
I've put together version 1.1.0~beta1 of the script that just plays through everything. It builds the playlist as it goes, so it starts playing quickly without setting a limit.

It's a beta as it could still behave weird and need tweaking, and I don't care much for the file system handling at the moment. I'm also curious to hear how it works on a lower powered device like the Raspberry Pi.

I've added it to my dev repo, or you can download it directly.

I'd like to hear your thoughts on combining the context item and the script into one add-on, and using a switch in the add-on settings to enable and disable it. This should make it simpler to install and use.

On an unrelated note, I am digging Killjoys, Dutch is a bit of a badass.
Reply
#20
I'm a pi3 user here using openelec 6.0.3. I installed your script and when I launch it, I get the same message to See README file

Does your script have to be manually updated to include the path of the movies I want to play? I see an area in the script where you could edit it, but is that supposed to be done automatically during launch?
Reply
#21
(2016-08-24, 17:48)NinjaJc7 Wrote: I'm a pi3 user here using openelec 6.0.3. I installed your script and when I launch it, I get the same message to See README file

Does your script have to be manually updated to include the path of the movies I want to play? I see an area in the script where you could edit it, but is that supposed to be done automatically during launch?

The simplest way to use this script is the context item Play Random Video, which can be used from the Kodi context menu on nearly any list of videos.

Install the "Context menus" add-on Play Random Video from the official Kodi Add-on repository, then highlight a TV show in your library and open the context menu, towards the bottom there will be a "Play Random" button that will play a random episode from that TV show; it works the same for other supported lists or collections of videos.
Reply
#22
Found it!

Can you modify it so that it continues to auto play the next random video until the user stops it? I think that would make this a great feature since there isn't a shuffle built in.
Reply
#23
(2016-08-24, 21:47)NinjaJc7 Wrote: Can you modify it so that it continues to auto play the next random video until the user stops it? I think that would make this a great feature since there isn't a shuffle built in.

I have been working on that, and I have a beta version that can be installed from zip file.
Reply
#24
I'll check it out and post back. Thanks for the link!
Reply
#25
Unfortunately this addon is not working for me. Checked on multiple devices, same error in the log file:

Quote:00:31:55 T:5140 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: attribute of type 'NoneType' is not callable
Traceback (most recent call last):
File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.playrandomvideos\script.py", line 13, in <module>
import playrandom
File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.playrandomvideos\resources\lib\playrandom.py", line 4, in <module>
import quickjson
File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.playrandomvideos\resources\lib\quickjson.py", line 3, in <module>
import pykodi
File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.playrandomvideos\resources\lib\pykodi.py", line 12, in <module>
datetime.strptime('2112-04-01', '%Y-%m-%d')
TypeError: attribute of type 'NoneType' is not callable
-->End of Python script error report<--
Reply
#26
so something I found that this works well if I'm using yatse app from an android phone is that the system will let me choose this play random videos from a list of videos.

I'm using the beta, but it seems to be hit/miss when it's playing a movie after the current random movie has been selected. Sometimes it works and sometimes it will freeze when choosing a movie.

I could run a log if you'd like.
Reply
#27
(2016-08-31, 00:40)DePeut Wrote: Unfortunately this addon is not working for me. Checked on multiple devices, same error in the log file:

Quote:00:31:55 T:5140 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: attribute of type 'NoneType' is not callable
Traceback (most recent call last):
File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.playrandomvideos\script.py", line 13, in <module>
import playrandom
File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.playrandomvideos\resources\lib\playrandom.py", line 4, in <module>
import quickjson
File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.playrandomvideos\resources\lib\quickjson.py", line 3, in <module>
import pykodi
File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.playrandomvideos\resources\lib\pykodi.py", line 12, in <module>
datetime.strptime('2112-04-01', '%Y-%m-%d')
TypeError: attribute of type 'NoneType' is not callable
-->End of Python script error report<--

That's a bug I've come across when multiple add-ons use the datetime module. Restarting Kodi will give the add-on another chance for now, but for the future I'll take a look at making this more resilient. Thanks for posting this.

(2016-08-31, 01:00)NinjaJc7 Wrote: so something I found that this works well if I'm using yatse app from an android phone is that the system will let me choose this play random videos from a list of videos.

I'm using the beta, but it seems to be hit/miss when it's playing a movie after the current random movie has been selected. Sometimes it works and sometimes it will freeze when choosing a movie.

I could run a log if you'd like.

Please do post a debug log. When it freezes, could you give it 2 minutes before restarting Kodi? I'd prefer it not take more than a handful of seconds, but I am curious if it will work itself out given more time. Post your log either way. I've also got a question that the log won't answer: does it always happen after a particular number of movies, maybe after the 3rd or 4th movie, or does it happen randomly after the either the first 1, or 2, or X?
Reply
#28
Seems that I have got a second (more persistent) error. Just using a fresh installation of Kodi, installed only this addon and browsed using Videos --> files --> folder with multiple videos --> c --> Play Random

Quote:22:48:56 T:6160 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ValueError'>
Error Contents: need more than 1 value to unpack
Traceback (most recent call last):
File "C:\Users\Yard\AppData\Roaming\Kodi\addons\script.playrandomvideos\script.py", line 54, in <module>
main()
File "C:\Users\Yard\AppData\Roaming\Kodi\addons\script.playrandomvideos\script.py", line 27, in main
pathinfo = get_pathinfo()
File "C:\Users\Yard\AppData\Roaming\Kodi\addons\script.playrandomvideos\script.py", line 42, in get_pathinfo
path_type, db_path = pathinfo['full path'].split('://')
ValueError: need more than 1 value to unpack
-->End of Python script error report<--
Reply
#29
(2016-08-31, 22:53)DePeut Wrote: Seems that I have got a second (more persistent) error. Just using a fresh installation of Kodi, installed only this addon and browsed using Videos --> files --> folder with multiple videos --> c --> Play Random

Quote:22:48:56 T:6160 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ValueError'>
Error Contents: need more than 1 value to unpack
Traceback (most recent call last):
File "C:\Users\Yard\AppData\Roaming\Kodi\addons\script.playrandomvideos\script.py", line 54, in <module>
main()
File "C:\Users\Yard\AppData\Roaming\Kodi\addons\script.playrandomvideos\script.py", line 27, in main
pathinfo = get_pathinfo()
File "C:\Users\Yard\AppData\Roaming\Kodi\addons\script.playrandomvideos\script.py", line 42, in get_pathinfo
path_type, db_path = pathinfo['full path'].split('://')
ValueError: need more than 1 value to unpack
-->End of Python script error report<--

Doh! That is a silly error on my part.

I'll post a new beta in the next day or so, fixing both this and the other (datetime) error you encountered.
Reply
#30
(2016-09-03, 02:17)rmrector Wrote: I'll post a new beta in the next day or so, fixing both this and the other (datetime) error you encountered.

The datetime error can be fixed by importing the time module and catching the TypeError exception in script.playrandomvideos/resources/lib/pykodi.py:

Code:
try:
        datetime.strptime('2112-04-01', '%Y-%m-%d')
except TypeError:
        datetime.fromtimestamp(time.mktime(time.strptime('2112-04-01', "%Y-%m-%d")))

With the changes above the script no longer stops working for me when attempting to randomize more than one show.

Thank you for taking the time to work on this addon! Great job so far.
Reply
  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 9

Logout Mark Read Team Forum Stats Members Help
Play Random Videos - context item and script2