Kodi is a media center that use's a file called the playercorefactory.xml to define external video and audio players
Using the playercorefactory.xml we can define a new player that runs a python 3 script i wrote called pilfer to record videos and audio from within Kodi or on the command line
https://www.youtube.com/watch?v=uKRU74Uqj1s&list=PL7hhhG5qUoXmtylBpTV4AdjFkYOj2soEB
The pilfer script takes the link from Kodi looks for the url, user-agent, referer and cookies,
then creates an ffmpeg command to record the audio or video stream from any kodi addon
Kodi use its own format for links that contain user-agent, referer and cookies which cant be directly recorded with ffmpeg
you have to extract the various parts of the url to use with ffmpeg, pilfer automates that process
The script works on linux,mac,unix and windows
After installing the pilfer script you install the playercorefactory.xml file to your ~/.kodi/userdata directory on linux, or appropriate path on other operating systems
then in kodi you press c on the keyboard on any video or audio link in an addon and choose Play with ...
This opens a menu where you can choose from the following options
play - uses pilfer to create a url that mpv can play and opens mpv as an external video player
record video - record without specifying a duration
record video 1 hour
record video 2 hours
record video 3 hours
save url
record audio - record without specifying a duration
record audio 1 hour
record audio 2 hours
record audio 3 hours
You can also save the url from kodi and record on the command line
to display the script help run
which outputs the followngCode:pilfer -h
-h --help display help
-i 'url' or text file - record video
-a 'url' or text file - record audio
-t '00:00:00'
pilfer -i/-a-t <00:00:00>
Its also possible to schedule recordings by using the at command on linux to record a link at a certain time of the day and specify a duration for the recording
I wrote Pilfer about 5 years ago and it still works with the latest version of Kodi,
i havent updated it in 3 years because if it aint broke dont fix it and the structure of the kodi urls hasnt changed in that time
The original version of the script was called kodi-playercorefactory and was written in bash about 6 years ago
+ Reply to Thread
Results 1 to 4 of 4
-
-
I am trying to run this on macOS. I followed the instructions exactly as on the github macOS setuppage. Kodi crashes as soon as I hit "save url". No url is saved on the destkop and I dont get that external player active popup. What could I be doing wrong?
I am using Python 3.7, Kodi 20.2.
Any help would be appreciated.
I also tried this on a windows OS. I got the same error. No video URL was saved. I dont get that external player active popup on there too.Last edited by sumit; 28th Nov 2023 at 18:13.
-
OkI got it to work. The fault lies in the mpv player that was crashing. I just used the contextual menu before playing the stream to save the url and record. Amazing work! I am surprised no one even left a thanks to you here! A heart full thanks to you!! Keep up the good work!
Last edited by sumit; 28th Nov 2023 at 18:51.
Similar Threads
-
Kodi's video output settings
By Reading Bug in forum Newbie / General discussionsReplies: 0Last Post: 7th Feb 2020, 13:36 -
How to add fonts to Kodi 16.0?
By Patapin in forum Media Center PC / MediaCentersReplies: 1Last Post: 11th Aug 2019, 13:07 -
Watching a M3U8 stream in KODI
By pir8skin in forum Video Streaming DownloadingReplies: 0Last Post: 1st Mar 2019, 03:19 -
kodi old version
By Marco Mueses in forum Newbie / General discussionsReplies: 1Last Post: 14th Apr 2017, 22:57 -
What happened to Kodi?
By flashandpan007 in forum Off topicReplies: 6Last Post: 2nd Apr 2017, 13:44