Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Allow downloading and playing from cache #18

Closed
wants to merge 1 commit into from

Conversation

michaelarnauts
Copy link
Collaborator

Since there is an issue playing back some streams (see #4), I looked into a workaround for the meantime untill this is fixed on the Kodi side.

This PR adds an option to download episodes to disk by using the context menu on an episode. It then spawns an ffmpeg (that should be installed by yourself) and downloads the file to a selected folder. Then, when you want to play the episode, it will indicate that a cached copy is available and starts to play from there.

Remarks:

  • Files are named according to the UUID of the video stream, so it can be looked up easy by code if a cached copy is available. It's hard to see what file is what episode by looking at the filenames.
  • There is currently no expiration of cached episodes, nor removal of cached episodes.
  • When you cancel a download, the file isn't removed. When you download it again, the existing file is overwritten.
  • Since ffmpeg needs to write to a file, I can't use xbmcvfs, so I can't use mapped folders on network shares. Maybe there is another way for this? Does kodi map network shares on the filesystem somewhere?
  • I have only tested this with ffmpeg 4.1.4, I have no clue if it works on older versions. My ffmpeg automatically seems to select program with the best resolution from the m3u manifest. I'm not sure if this happens on older versions also.
  • I have only tested this on De Mol s07e01, and only for the first 20 seconds. That error was handled fine.
  • I'm not sure if this is okay for the official Kodi add-on repository.

@dagwieers or @mediaminister Feel free to do some testing or give feedback.

@michaelarnauts
Copy link
Collaborator Author

It seems to work also on ffmpeg 3.2 on my OSMC box.

@mediaminister
Copy link
Collaborator

I tested on Kodi 19 and Kodi 18.6 on Linux and it works fine. For Kodi 19 an updated kodiutils was needed because the Python API for the Dialog functions changed. I made a pull request for this: #20

@michaelarnauts
Copy link
Collaborator Author

This is not the way to success :)

@dagwieers dagwieers added the enhancement New feature or request label May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants