Python: getter for playing playlist full system path - still no solution!
#1
Video 
[if you have a suggestion on where to ask this question please let me know]

When you open a playlist using PlayMedia("full m3u path") or via GUI,
how do you later get the full path of the currently playing playlist from Python script?

Example:
<Playlist path: /home/kodi/playlists/playlist.strm>
# content of playlist.strm file
# link 1
http://some.link.com/stream1
# link 2
http://some.link.com/stream2

xbmc.getInfoLabel("Player.Filenameandpath") will return
either "http://some.link.com/stream1" (if it is playing now)
or "http://some.link.com/stream2" (if this one is playing now)

how to retrieve the "/home/kodi/playlists/playlist.strm"?
Reply
#2
(2015-10-29, 15:31)mcrs Wrote: [if you have a suggestion on where to ask this question please let me know]

When you open a playlist using PlayMedia("full m3u path") or via GUI,
how do you later get the full path of the currently playing playlist from Python script?

Example:
<Playlist path: /home/kodi/playlists/playlist.strm>
# content of playlist.strm file
# link 1
http://some.link.com/1.m3u
# link 2
http://some.link.com/2.m3u

xbmc.getInfoLabel("Player.Filenameandpath") will return
either "http://some.link.com/1.m3u" (if it is playing now)
or "http://some.link.com/2.m3u" (if this one is playing now)

how to retrieve the "/home/kodi/playlists/playlist.strm"?

http://mirrors.xbmc.org/docs/python-docs...layingFile
http://mirrors.xbmc.org/docs/python-docs...l#PlayList
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#3
Lunatixz, getPlayingFile(...) returns the same as Player.Filenameandpath infolabel (path of currently playing item from the playlist)
I do not see the getter in the Playlist class. It does not have the getter for playlist full path. I already tried it before.
Reply
#4
(2015-10-29, 15:56)mcrs Wrote: Lunatixz, getPlayingFile(...) returns the same as Player.Filenameandpath infolabel (path of currently playing item from the playlist)
I do not see the getter in the Playlist class. It does not have the getter for playlist full path. I already tried it before.

Yeah player info wouldn't work out... you'd need the infolabel... is the strm selected by the user? could parse listitem information?
http://kodi.wiki/view/InfoLabels#Listitem
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#5
(2015-10-29, 16:22)Lunatixz Wrote: is the strm selected by the user? could parse listitem information?

Generally speaking, no.
This question arose due to inability ("insufficient knowledge" in case the simple solution exists) to get the path of playlist in script_2.py
after script_1.py (invoked independently)
invokes PlayMedia("path").

It seems, once you invoke it and the playlist started playing, you do not seem to be able to extract the playlist path later. It is amazing to me how such a simple getter does not exist.
Reply
#6
(2015-10-29, 16:31)mcrs Wrote:
(2015-10-29, 16:22)Lunatixz Wrote: is the strm selected by the user? could parse listitem information?

Generally speaking, no.
This question arose due to inability ("insufficient knowledge" in case the simple solution exists) to get the path of playlist in script_2.py
after script_1.py (invoked independently)
invokes PlayMedia("path").

It seems, once you invoke it at the playlist starts playing, you do not seem to be able to extract the playlist path.

Once the player resolves the path, player returns that information not the original strm file.

You would have to capture that information before the player, perhaps parse the strm list, and its internal link...

Compare internal link with players filename, and you have the original strm?

You could also put all the strms into a m3u playlist, then you could use the internal kodi playlist handling to get the filename

BTW I just realized this thread should have been posted in addon-development section not the help subforum.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#7
I will repost, but it seems you do not get the idea.
I have an m3u list (strm is the same thing) = container.
Each link is http stream. But it does not matter, it can be a list of local items. Each item, of course, has its own path.
There's a path of the container (m3u)
There's a path of each item in the container.

If XBMC/Kodi "forgets" the original container (path of m3u) that is WEIRD.
Reply
#8
Star 
When you open a playlist using PlayMedia("full m3u path") or via GUI,
how do you later get the full path of the currently playing playlist from Python script?

Example:
<Playlist system path: /home/kodi/playlists/playlist.m3u, that is, path to the text m3u file>
# content of playlist.m3ufile
# EXTINF:link 1
http://some.link.com/link1
# EXTINF:link 2
http://some.link.com/link2

xbmc.getInfoLabel("Player.Filenameandpath") will return
either "http://some.link.com/1.m3u" (if it is playing now)
or "http://some.link.com/2.m3u" (if this one is playing now)

how to retrieve the path "/home/kodi/playlists/playlist.m3u" any time in python script (e.g. spontaneously invoking the python script while playing the loaded playlist)?
Reply
#9
(2015-10-29, 16:54)mcrs Wrote: I will repost, but it seems you do not get the idea.
I have an m3u list (strm is the same thing) = container.
Each link is http stream. But it does not matter, it can be a list of local items. Each item, of course, has its own path.
There's a path of the container (m3u)
There's a path of each item in the container.

If XBMC/Kodi "forgets" the original container (path of m3u) that is WEIRD.

a m3u and a strm is NOT the same thing...
sure both are types of playlists but both are treated differently by Kodi.

Kodi's player resolves the strm because its a shortcut, a container as your pointed out... and is not WEIRD.

Your mistake is assuming a m3u and strm are the same.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#10
ORG POST : http://forum.kodi.tv/showthread.php?tid=245737
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#11
Well, OK, I cannot do with both.
It is not important to me where to put the links.
How to get the full playlist (container) path ? (tell me to use ANY extension, basically it's the same, just the list of full paths of http streams or local files)
After all, this container is just a PLAIN TEXT FILE. It has a system path! As we discussed, the Playlist object is an object representation of this file, how on Earth does it not contain its path? The constructor should save it!

Suppose, I put the links to .m3u or .strm or whatever you tell me.

Next I invoke in .py
PlayMedia("full path to playlist")

Now I need to get the container full path (whatever it was - m3u strm pls etc) in another independent script

HOW??
Reply
#12
Still looking for someone who will tell (and explain why): this is impossible in Kodi.
Reply
#13
My guess! Is that all the items in the playlist is simply being added to tje queue of the player as simple playabæe items? At least that is sort of what i see when playing songs from an album. My solution is to write my own script that adds songs to the queue but includes album info as a parameter in the listitem in the queue. A path to the playlist it originates from ahould also be possible to add.

Again, i am just guessing here as probably only a select few very busy people knows anyrhing about the inner workings... good luck :-)

Pardon all tje typos. Idiot phone (with an idiot typing even).
Reply
#14
sorry, just not understanding the question properly, but if you're passing the stream, how would you not know the stream path? for example if I do,

my_video = "http://example.com/video.m3u8"
PlayMedia(my_video)

I'd know the path by calling my_video.

am I missing something?
Reply
#15
I think there could be more playlists imported to the queue, so therefore also more paths? Not sure, just trying to be helpful.
Reply

Logout Mark Read Team Forum Stats Members Help
Python: getter for playing playlist full system path - still no solution!0