Git Product home page Git Product logo

ipfsflix's Introduction

IPFSFLix


Concept

IPFS has features that go well with serving videos across networks.

With the IPFS network mounted to a local machine Jellyfin & Plex are capable of having cached video libraries.

Devices with limited storage can have access to a huge on-demand library. Say a Raspberry Pi at an office, relative's home, etc.

IPFS by itself can easily turn into a confusing maze.
Media Organizers like Jellyfin & Plex seem like a natural fit to this maze.


IPNS

'Server' nodes with a large amount of storage can create IPNS keys for collections of files. They can 'publish' updates to this address as they add/remove content.

'Client' nodes then resolve this IPNS address to get updates.

All nodes can be clients & servers. Anything cached to a 'client' node acts as +1 source for the network.


ipfsflix-add-movies.bash

Adds videos using the IPFS 'filestore' (to not use extra space) to IPFS & the IPFS MFS filesystem under '/movies/'

You need to have created a /movies/ directory with a command like ipfs files mkdir /movies/

Currently, only adds the main video, no subs or other files. Only grabs mp4 & mkv files.

Run in the directory you have a bunch of mp4 & mkv files.

It keeps a file list at ${confdir}/ipfsflix-filesystem.list.


ipfsflix-add-file.bash {file/directory name}

Adds a single file/directory to ipfsflix. Ignores any *.txt, *.nfo, *.rar, *.exe files if it's a directory being added.

Prompts for IPFS_PATH to use.

Prompts for IPFS MFS location to save. (currently one level)

It keeps a file list at ${confdir}/ipfsflix-filesystem.list.


ipfsflix-add-url.bash {URL of video}

There aren't that many direct links to videos hanging around anymore, but if you find some you can add them to IPFSFLix.

The script prompts the user to name the directory to place the file in, since it could be nonsensical to pull text from the URL.

Then the script prompts for the IPFS_PATH and IPFS MFS directory to save it within.

IPFS will download the URL and if successful add it to the IPFS MFS.

This does not save the video to the server.

When the file is called over the network the host machine will re-download the file to serve the blocks on IPFS.


ipfsflix-ipns-refresh.bash

Uses a text file such as the ipfsflix-namemap.list.sample to create symlinks in a specified directory. This resolves the IPNS address to an IPFS address to prevent the directory from hanging when IPNS is unresovlable.


ipfsflix-mfs-remap.bash

Sometimes the IPFS MFS seems to lose track of things. I'll have files that go missing.

ipfsflix-mfs-remap.bash goes through the ipfsflix-filesystem.list to 'remap' anything that wasn't in the MFS.


ipfsflix-publish.bash

Publishes your IPFS MFS directories to their corresponding keys. Publishing 'movies' with the 'movies' key, 'series' with the 'series' key, for example, etc.


ipfsflix-rm-file.bash {search phrase}

Searches the ipfs-filesystem.list file to prompt for the deletion of files from the IPFS MFS, the IPFS pin, and then finally the ipfs-filesystem.list itself.


ipfsflix-namemap.list.sample

A text file that stores the IPNS addresses to resolve to symlinks.

Fields
  • Relative Path to IPFS/IPNS Mounts - Used to tell the script where the mounted IPFS/IPNS endpoints will be located. Useful if you have multiple IPFS mountpoints, perhaps the main swarm and a private swarm. Something like ../../.. if the /ipfs/ mount is three directories above the symlink directory.
  • Symlink name - The name you want to give the symlink directory.
  • IPNS address - The IPNS address that will be resolved for that symlink.
  • IPFS_PATH - The IPFS_PATH needed to access the right IPFS daemon. Most people would use ~/.ipfs/ for the default public swarm.

Uses '::' separators.

Example to a small public domain sample of videos,

../../..::ipfs-public-domain::/ipns/k51qzi5uqu5dm003wyasjdmljt5ekqos1ptq73n2l2zplvv9672jqkftlqyica::~/.ipfs/

Goes in the confdir configuration directory set in ~/.config/ipfsflix.conf.


ipfsflix-paths.list.sample

A list of your IPFS_PATHs. Most people probably have the main swarm at ~/.ipfs. If you have private swarm node locations add them here as well.

Goes in the confdir configuration directory set in ~/.config/ipfsflix.conf.


ipfsflix-filesystem.list.sample

The scripts that add files should add to this file in the confdir configuration directory.

ipfsflix-rm-file.bash removes lines from this file when files are unpinned and removed from the IPFS MFS.

Goes in the confdir configuration directory set in ~/.config/ipfsflix.conf.


Rough Idea

  1. Add media to IPFS using the IPFS 'filestore.'
  2. Create an IPNS directory that virtually holds that media.
  3. Share this IPNS address with other devices.
  4. Other devices symlink the IPNS address to the IPFS 'mount' locations.
  5. Jellyfin & Plex add those symlinked directories to their Libraries.
  6. Use Jellyfin & Plex as normal.
  7. Use a Private Swarm if you want privacy.

Bugs

There's probably lots of bugs.

I don't guarantee that anything here works at any given point.

ipfsflix's People

Contributors

jay4242 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ipfsflix's Issues

Jellyfin

Does jellyfin not work with symlinks anymore or is it something else? Just me?

removing content

Something went wrong the last time I tried to remove content. I think the filesystem.list wasn't being updated correctly.

Series

Series are slightly different because you may have a season of something and want to place it in a subdirectory whereas other files would just go in something like /movies/.

Just have to make a way to select creating new directories and then selecting a subdirectory to place it in for say 'season.01', 'season.02', etc.

Organization

I should probably put all the filelists and configuration things in one directory. Say .config/ipfsflix/

Maybe a file that points to that location in case people want to change it?

The symlink directory, filelists and configuration settings need to be in set in one location. Can also stick the ${timeout} in there.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.