# Private Netflix-like clone in Flask



## fisle (Dec 16, 2013)

Hey everyone! I figured that if I never release my code to public, I'm never going to improve. I realize my code is amateurish at best and is full of bad practises. Please help me improve by giving constructive criticism.

I have written a small Netflix-like HTML5 video gallery in Flask, Python as a learning process for me. I've been learning Flask for like two months now, as a hobby. It's intended usage is well.. sharing your bought movies in LAN for your family, duh.

I have uploaded it to vpsBoard git: http://git.vpsboard.com/fisle/netflask

Features:

- Authentication

- Automatic scanning and encoding of video files (Set up a cronjob)

- Subtitle support

- Fetching movie data from RottenTomatoes (Requires free API key)

- Uses X-Accel-Redirect to serve files securely (Need HTTP daemon for this, I used Nginx)

By default it does not support Firefox for Linux, but you can enable encoding to webm in sources.

I have included some screenshots for you:

Home screen.

New movie found!

Select movie from list to add its data

I have released this under WTFPL, so fork it and do something with it 

Set up instructions are in Git, feel free to ask if(when) you run into issues.


----------



## MannDude (Dec 16, 2013)

Awesome! I'll have to look at it a bit more later on.


----------



## mikho (Dec 16, 2013)

Nice project, could be something i stead of running a plex server at home.


----------



## fisle (Dec 16, 2013)

mikho said:


> Nice project, could be something i stead of running a plex server at home.



Yup, I was looking at options to have movies streamed in LAN/WAN, Plex was one of the options but I decided I wanted clientless model


----------



## Hugohp (Dec 16, 2013)

Excellent project, I have something similar but in PHP and without video encoding. Have you considered OpenSubtitles API for Automatic subtitle downloads?. If not, Look at it =)

Hugo


----------



## 5n1p (Dec 16, 2013)

This looks great, will try it as soon as possible


----------



## fisle (Dec 16, 2013)

Hugohp said:


> Excellent project, I have something similar but in PHP and without video encoding. Have you considered OpenSubtitles API for Automatic subtitle downloads?. If not, Look at it =)
> 
> Hugo



This sounds very good. I will definitely take a look at it - Thanks!


----------



## fisle (Dec 17, 2013)

Images seem to return 404; Here's them hosted on imgur:

Main view

New video found

Name it

There it is!


----------



## fisle (Dec 17, 2013)

Automatic subtitle downloading is now somewhat implemented. Also fixed issue with scan.py not encoding things properly.

Has anyone tried this yet?


----------



## Echelon (Dec 17, 2013)

Could use a tad bit of polishing interface-wise, but definitely a start and something to work with for anybody who wants to continue running with it.


----------



## fisle (Dec 17, 2013)

Echelon said:


> Could use a tad bit of polishing interface-wise, but definitely a start and something to work with for anybody who wants to continue running with it.



Yeah, interface designing is obviously not my strong area 

However, Jinja2 templates are easy to play with. I'm providing the basic skeleton upon which you can build the muscles


----------



## fisle (Dec 23, 2013)

Couple of updates:


Simple search by tags
User roles (Admin, moderator, normal user)
A bit colors on layout 
Sorting by name/rating
Password change function


----------



## fisle (Dec 31, 2013)

Nobody using it? Aww 

Updates:


New layout!

Reworked subtitle support (more intelligent)


----------



## mikho (Dec 31, 2013)

I've been working on the house whole year and only have laptops running (server in the garage, turned off).


When I get it back online in February(?), I'll give it a test run.


----------



## blergh (Dec 31, 2013)

Cool idea, i could try it out later.


----------



## joepie91 (Dec 31, 2013)

Hmm, looks like the screenshot links in the original post are gone? Can you reupload them on imgur or something?


----------



## fisle (Dec 31, 2013)

joepie91 said:


> Hmm, looks like the screenshot links in the original post are gone? Can you reupload them on imgur or something?



Yup, cubeupload was silly and removed them. You can find them


----------



## joepie91 (Dec 31, 2013)

fisle said:


> Yup, cubeupload was silly and removed them. You can find them


Whoops, didn't notice that post


----------



## TheLinuxBug (Mar 25, 2014)

Finally got around to playing with this.  So far it works pretty good, @fisle had to help me a little bit and we modified it to work with shows instead of movies (otherwise is will insist you look up the video in the movie DB).  Hopefully down the line this option will be included so you can choose without changing the code. Even though this is a young platform it works pretty efficiently, look forward to seeing more development.

Anyhow, thanks again for this @fisle !

Cheers!


----------



## mikho (Mar 25, 2014)

Never got around to test it yet, what about TV-Series, does every episode end up as "a movie" or can/are they grouped together?


----------



## fisle (Mar 25, 2014)

Currently I wouldn't recommend using this with TV-series, as I did not think of them during development.

Every episode would end up as a new movie, and at the moment there's a problem because new movie info (description, ratings, genres) come from rottentomatoes api which AFAIK does not support tv-shows, so you would be unable to add the tv-show at all. For initial hack with @TheLinuxBug we made it to ignore all the info/etc and just put the filename as name, as per this image.

@TheLinuxBug suggested using tvrage api to get the info of tv-shows but first I need to fork in actual support for tv-shows in the first place.


----------



## mikho (Mar 25, 2014)

Thanks, I'll keep my eyes open when you add support for series then .


----------



## Nikki (Mar 28, 2014)

Tried it out, it was a bit tough to setup because I've never used Flask, but I eventually got it  It works very well, streaming is fast.

Also, add a custom subtitle directory option and an option to leave avi files alone, I've disabled both of those because otherwise it would take forever. Also try to add a delay after you finish typing to get results, the rottentomatoes API, or use http://www.themoviedb.org/ and http://thetvdb.com/ for info 

I've also noticed a bug with adding movies, when adding a movie to the database, you'll randomly get the previous movie name populated in ~ 1/5 of the select fields. Another bug is using names with periods etc in them, jQuery errors out.


----------



## Lorne (Mar 31, 2014)

Going to try this out on the weekend, thanks!


----------

