NapoleonWils0n / pilfer

pilfer - command line tool to record from Kodi
GNU General Public License v3.0
14 stars 3 forks source link

Invoking pilfer from simpleiptv #52

Closed ghost closed 3 months ago

ghost commented 4 months ago

I've been running pilfer for a year or so. I use Simple IPTV to watch m3u files based on the different channels with a different m3u link for each channel. I bound a key to my remote. I use to be able to watch a show and if I decided while watching that I wanted to watch the rest later I could tell pilfer to record for 30 minutes by invoking the key on my remote that is mapped to y and selecting record video for 30 minutes. It was convenient as it only took a few seconds to record versus going to ssh and looking at the log file as the command that shows in the log file works if I just enter it into a terminal and then I can see the file being created in the Desktop folder. I am running kodi as alarm which is the same user that I can enter the command into the terminal that works.

I also have movie links files that are strm but those don't record either. I select play using and then hit record for 30 minutes and I get a dialog box the pope up that says press okay when finished but nothing every gets recorded.

I have also tried to go into Simple IPTV in the guide and select the channel and then hit the menu and use play using.. but this doen't give me the pilfer popup as it just goes straight to playing the show.

I am running arch linux arm64 on a raspberry Pi 5 running Kodi 21. I am also running python 3.12.4. I am not sure if my issue was caused by the upgrade to from 3.9 to 3.12

NapoleonWils0n commented 4 months ago

Hi Mate, the keyboard has changed from y to c to bring up the contextual menu

you have to press c on a link and then select "play using" and then the menu appears

now for the bad news

Kodi 21.0_2 has broken the "play using" contextual menu in addons when you press c on a link in an addon the contextual menu appears

but there is no "play using" listed in the options this issue happens in addons, in the video queue and favourites

but the "play using" menu does appear on strm and m3u files

setting the default player in your playercorefactory.xml file still works

setting the default player to use the pilfer play

`

`

set the default player to "save url"

``

``

set the default player to "record"

``

``

set the default player to "record video - 30 minutes"

``

``

playercorefactory.xml

when you set the default player whenever you click on a link it will then use that player eg if you set the player to record it will record every link you click on

so in kodi 21.0_2 because the "play using" menu doesnt appear in addons you would need to use a workaround

what i would suggest is quitting kodi

1- edit the playercorefactory.xml file and change the default player to "save url" in the rules section as shown above 2 - reopen kodi click on some links and it wont play the video it will save the urls to the desktop 3 - close kodi - edit the playercorefactory.xml file and change the default player from "save url" back to what it was before 4 - rename the extension of the saved urls from .txt to .strm 5 - move the strm files to ~/.kodi/userdata/playlists/video 6- reopen kodi and press c on the strm files and then select play using

then you can play the video or record it if you just want to record you could set the default player to record, or record 30 minutes

if you are on linux, unix or mac you can use taskspooler to queue up a list of videos to record

https://odysee.com/@NapoleonWils0n:6/kodi-queue-videos-to-record-with-pilfer:3

on some versions of linux the taskspooler command is called tsp on other distros its called ts, so check what the command is and edit the playercorefactory.xml if needed

pilfer taskspooler

playercorefactory.xml taskspooler

this is the first time using kodi that the "play using" contextual menu hasnt shown up in addons

kodi 21 screenshot of play using menu

kodi-21

kodi 21.0_2 screenshot no play using menu

kodi-21-02

i found the issue of the "play using" menu not appearing in the contextual menu when you press c happening in the 3 addons im using

youtube, bbc iplayer and invidious

could you let me know what version of kodi you are using

im using pilfer with Kodi 21.0_2 on Freebsd

NapoleonWils0n commented 4 months ago

another option

create a new player in the playercorefactory.xml called strm as shown below

`

printf
 <args>"%s\n" "{0}" > "$HOME/.kodi/userdata/playlists/video/url-$(date +"%Y-%m-%d-%H-%M-%S").strm"</args>
 <hidexbmc>false</hidexbmc>

`

set it as the default player

`

`

then when you click on a link it will save the url as a strm file to ~/.kodi/userdate/playlists/video

then you can press c on the strm and then play using and then select play or record

should save a few steps

NapoleonWils0n commented 4 months ago

i posted a description of the issue on the kodi subreddit

https://www.reddit.com/r/kodi/comments/1e405be/kodi_210_2_play_using_option_not_in_contextual/

ghost commented 4 months ago

Thanks for the help. I am running Kodi 21.0.7. I have installed task-spooler as well (have to use makepkg on Arch).

I will remap the key on my remote to c. I can't remember which key I bound to (c or y) using the keymap editor addon. I can redo it as I only have one key remapping.

I will try both of the edits and see which one works the best.

I can't figure out though that it looks like it is passing my pilfer command they way I have it setup but it doesn't record. I suspect that it passes the command while kodi is still playing and it can't open the stream to record. I may try adding a kodi-send command to stop playing in the xml file before the pilfer command.

Cheers Mate

NapoleonWils0n commented 4 months ago

hi mate

so you use your remote to trigger the recording

you may have to press c on the remote and then the down key and select "play using"

and then select the player from the menu

do you have any issues with the "play using" menu not showing up in addons

ghost commented 4 months ago

I must've had my key mapped to y. As I am watching live tv, I could hit the key on my remote that was mapped to y and I would get the playercorefactory.xml that had save url (which works), record video, record audio etc and I would simply hit record video for 30 minutes or an hour and I would have the video in my desktop folder.

For movies and non-live tv shows, I use a program called m2strm that converts mkv file names from my m3u file into strm files and then I can scan them into a kodi. I wrote a script to do all this. Kodi must take the strm file and pull out the mkv link and display as a video. I tried just using my keyboard and hit c and then play using and then another menu popped up and I hit select record but it didn't record.

I will try some things in the AM as the fam is using the TV tonight. I will let you know if play using is visible in other addons.

Cheers Mate

NapoleonWils0n commented 4 months ago

Hi Mate, you might find these ffmpeg scrips useful

https://github.com/NapoleonWils0n/ffmpeg-scripts

ghost commented 4 months ago

I confirm that play using is missing in Youtube and other addons.

I tried the above. If I am looking at the EPG using Simple IPTV and I select play using it just starts playing without giving me an option to record.

If I am watching a show, I can get the menu by hitting y and then I select strm option. This puts a link in my playlist. I checked the file and it has the proper link. When I try to select record nothing happens as it doesn't record. I tailed the kodi log while doing this and nothing changed so I'm not sure if the command was sent to Kodi.

Cheers Mate

NapoleonWils0n commented 4 months ago

hi mate, cheers for checking if the play using menu shows up in addons

i wonder if its possible to create a new keymap that brings up a single menu with just the play using menu in it

at the moment because the play using menu doesnt appear when you press c in aaddon

the only work around is to change the default player in the playercorefactory.xml to record, or strm and then press c on the strm which does bring up the play using menu

very annoying

ill do some more digging and see if its possible to create a new menu

NapoleonWils0n commented 4 months ago

found this thread on the kodi github page

https://github.com/xbmc/xbmc/issues/24970

looks like kodi 21 has made changes that stops the "play using" menu appear anywhere except local files and strms

m3u dont seem to work the mneu appears but nothing happens when you select the player

ghost commented 3 months ago

Howdy Mate, I ended up installing inotify-tools and I am using inotifywait. I edited the .xml file to write a txt file to a directory when I select a record to say 30 minutes and I pass the url and the -t flag to the file. I then use inotifywait to check when a file is written to the directory and then my small script is executed to read in the file match it with the pilfer command an execute and then delete the txt file. It works well even though it's a bit hacky. I just use this to record while I am watching a show where I want to watch the rest later.