Code Monkey home page Code Monkey logo

bevy's Introduction

Bevy

Bevy is a self hosted alternative to Popcorntime that aims to improve file availability and increase control over the files being downloaded. With this added control we can:

  • Grab one file, and transcode to lower qualities (instead of grabbing a different file for each desired quality)
  • Keep and seed files for x amount of time depending on the tracker (so we aren't just leeching)
  • Use private trackers for torrents
  • Only use a VPN on the server, making it easier for devices to stream content

Gist of how it works

Torrents are grabbed from indexers by hitting Jackett (no need to reinvent the wheel here) and then sent to the torrent client. There they are served via HTTP and the file pieces are downloaded as they are needed/streamed. A media player then sits in front of this web server and transcodes the media files in real time (rather than downloading different versions) for the web client.

This means you can grab a single release at the highest quality/size you are willing, and transcode to meet your current internet speed wherever you are. No need for VPNs on your clients, all torrenting happens on your server/seedbox.

If you are still confused about why this project was started, check out the motivation section at the bottom... but also, I just had some free time and wanted to see how far I could take it :)

Demo

Dependencies

Torrent client

Bevy includes a fully featured torrent client so you can decide how you want the files to be downloaded and seeded (which helps solve issue 1 I mentioned above). We don't use existing clients because we specifically need the ability to serve files via HTTP and prioritize those streams over downloading the entire torrent.

Features:

  • Serves raw files via HTTP range requests which downloads pieces when they are needed
  • Add torrents via info hash
  • Add torrents via magnet url
  • Add torrents via file on disk
  • Find Movie files/torrents via Torznab queries
  • Endpoint to check if a movie exists on disk already
  • Find TV Shows/Episode files/torrents via Torznab queries
  • Endpoint to check if a tv show or episode exists on disk already
  • Download all pieces of a torrent when no one is streaming
  • Web interface for managing torrents

Media Player (realtime transcoder)

Bevy also includes a layer on top of the raw files that aims to make your files as available as possible.

Features:

  • Transcode to different resolutions and bitrates
  • Provide detailed metadata about files including all video/audio/subtitle tracks
  • Transcode to different file formats
  • Add subtitles during transcode
  • Serve subtitle track so the client can decide if it wants to render them

Web Client

The web client is fairly independent of the backend and aims to make it easy to select movies and then provide the backend the info it needs to go find a torrent for that movie.

Features:

  • Use TMDB api to get info on media
  • Request movies to be fetched
  • Stream movies
  • Option to select transcode quality
  • Page for movies with status about files on disk

Deployment

Building (optional)

make docker

Running on x86

docker run -it \
-v $(pwd)/downloads:/downloads \
-v $(pwd)/config.toml:/config.toml \
-e CONFIG_FILE=/config.toml \
-p 8080:8080 \
zolland/bevy:latest

Running on ARM64 (tested on Pi 4 Model B)

docker run -it \
-v $(pwd)/downloads:/downloads \
-v $(pwd)/config.toml:/config.toml \
-e CONFIG_FILE=/config.toml \
-p 8080:8080 \
--entrypoint "/linux-arm64" \
zolland/bevy:latest

Docker Compose

jackett:
    image: linuxserver/jackett
    container_name: jackett
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Los_Angeles
    volumes:
      - jackett:/config
      - /downloads:/downloads
    ports:
      - 9117:9117
    restart: unless-stopped

bevy:
    container_name: bevy
    image: zolland/bevy:latest
    user: 1000:1000
    restart: unless-stopped
    ports:
      - 8086:8080
    environment:
      - CONFIG_FILE=/etc/bevy/config.toml
    volumes:
      - /etc/bevy/config.toml:/etc/bevy/config.toml
      - /mnt/media/bevy/downloads:/downloads

Development

When developing you need to run the frontend and backend as sepperate services.

Backend

CONFIG_FILE=config.toml go run cmd/main.go

Available on localhost:8080

Frontend

Install deps

pushd frontend && yarn

Start

pushd frontend && yarn start

Available on localhost:3000

Motivation for this project (issues with Popcorntime)

Popcorntime is awesome for torrent usability, but has a few problems that make it a bit hard to use (for me). I think the easiest way to understand the motivation behind this project is to look at the problems I have with Popcorntime.

Remember that this isn't meant to bash their appliction! These are two completely different projects that tackle the problem of torrent streaming in totally different ways.

1. Hard to seed

PT has very little emphasis on seeding. You seed while you watch, but stops seeding when you close the app. This means there's no way you could use a private tracker, and in general you're just being a leech!

2. You need a VPN on all devices

Because each of the apps are actively torrenting, you end up needing to have a VPN on all of your devices you want to watch on. I don't usually like to have a VPN active on all my devices at all times and think it's a bit annoying to keep switching them on and off when I want to watch some shows.

3. Bad file availability

A smaller issue I noticed is that PTs solution to poor internet connectivity is to select a lower quality torrent rather than adjust the file you are downloading.

bevy's People

Contributors

brianbushree avatar diericx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bevy's Issues

Couldn't open torrent file at downloads/.bevy.storm.db.

Hey diericx, love the project! I've been trying to run a local instance but found an issue where I'm not sure what to do, I have setup bevy using docker-compose example in your readme and using the example-config.toml provided. after running docker-compose up -d jackett starts normally but bevy logs:

Couldn't open torrent file at downloads/.bevy.storm.db. The file will be created if it doesn't exist, make sure the directory exists and user has proper permissions.

I'm might be missing something but can't figure out what. ๐Ÿค”

Use and Store metainfo.Hash instead of strings

Currently we are using and storing metainfo hash as a string which means there is a lot of weird conversions back and forth happening in our code.

metainfo.Hash is just a byte array, so let's just use that instead of messing with them both. The rest api should take in a string convert to metainfo.Hash then that will be input for the functions.

exec format error

I tried to run:
docker run -it -v $(pwd)/downloads:/downloads -v $(pwd)/internal/app/http/templates:/internal/app/http/templates -v $(pwd)/config.toml:/config.toml -e CONFIG_FILE=/config.toml -p 8080:8080 iceetime/iceetime:latest

but i got this error:
docker: Error response from daemon: manifest for iceetime/iceetime:latest not found: manifest unknown: manifest unknown.

So i added the tag 92.18c3978 instead of iceetime/iceetime:latest

Then i got this error:
standard_init_linux.go:211: exec user process caused "exec format error"

Machine: Raspberry pi 4 model B
OS: ubuntu 20.04
Docker version: 19.03.8
Processor architecture: aarch64

I am very interested in this project, can you help me with that? Thanks a lot!

Does not start without IPv6 support

Fails with:

2021/09/12 08:21:40 Couldn't start torrent client: subsequent listen: listen tcp6 :42069: socket: address family not supported by protocol

Add basic UI to torrent client

Torrent client needs basic UI

  • List of torrents (name, size, peers) and their status (completed, downloading, seeding)
  • Sort by status

"Transcode failed"

Hi! I set up Bevy on a server with ffmpeg installed, but when I try to play something I get "The media could not be loaded, either because the server or network failed or because the format is not supported." in the browser. If I CURL the request I see this:

{"error":true,"message":"Transcoding failed"}

The weird thing is that if I call ffmpeg myself with something like this

ffmpeg -ss 00:00:00 -i http://domain:8086/v1/torrents/torrent/hash/stream/0 -f ismv -c:v libx264 -c:a libmp3lame -maxrate 1G -vf scale=iw:ih -threads 0 -preset veryfast -tune zerolatency -map 0:v:0 -map 0:a:0 -movflags frag_keyframe+empty_moov testfile

it works. What am I missing? Thanks!

"Error: " message when click on watch movie button.

Backend server log:

[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.

  • using env: export GIN_MODE=release
  • using code: gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET /v1/tmdb/browse/movies/popular --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTmdbGroup.func1 (6 handlers)
[GIN-debug] GET /v1/tmdb/search/movies --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTmdbGroup.func2 (6 handlers)
2020-10-28T20:33:49+0200 NONE server.go:923: dht server on [::]:42069: falling back on starting nodes
[GIN-debug] GET /v1/tmdb/movies/:movieID --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTmdbGroup.func3 (6 handlers)
[GIN-debug] POST /v1/torrents/new/file --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTorrentsGroup.func1 (6 handlers)
[GIN-debug] POST /v1/torrents/new/magnet --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTorrentsGroup.func2 (6 handlers)
[GIN-debug] GET /v1/torrents --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTorrentsGroup.func3 (6 handlers)
[GIN-debug] GET /v1/torrents/torrent/:infoHash --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTorrentsGroup.func4 (6 handlers)
[GIN-debug] GET /v1/torrents/torrent/:infoHash/stream/:file --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTorrentsGroup.func5 (6 handlers)
[GIN-debug] GET /v1/torrents/find_for_movie --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTorrentsGroup.func6 (6 handlers)
[GIN-debug] GET /v1/transcoder/from_url --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTranscoderGroup.func1 (6 handlers)
[GIN-debug] GET /v1/transcoder/from_url/metadata --> github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTranscoderGroup.func2 (6 handlers)
[GIN-debug] Environment variable PORT="8080"
[GIN-debug] Listening and serving HTTP on :8080
2020-10-28T20:33:49+0200 NONE server.go:923: dht server on 0.0.0.0:42069: falling back on starting nodes
2020-10-28T20:33:49+0200 NONE upnp.go:130: UPnP discovery result 9f0865b3-f5da-4ad5-85b7-7404637fdf37/Archer_MR200/urn:upnp-org:serviceId:WANIPConn1/urn:schemas-upnp-org:service:WANIPConnection:1/http://192.168.1.1:1900/upnp/control/WANIPConn1
2020-10-28T20:33:51+0200 NONE portfwd.go:30: discovered 1 upnp devices
2020-10-28T20:33:52+0200 NONE portfwd.go:17: forwarded external TCP port 42069
2020-10-28T20:33:52+0200 NONE portfwd.go:17: forwarded external UDP port 42069
2020-10-28T20:33:56+0200 NONE client.go:332: dht server on [::]:42069 completed bootstrap (dht.TraversalStats{NumAddrsTried:9, NumResponses:0})
[GIN] 2020/10/28 - 20:34:19 | 200 | 1.477822123s | 127.0.0.1 | GET "/v1/tmdb/movies/724989"
2020/10/28 20:34:21 INFO: Passing on release Hard Kill 2020 FRENCH BluRay 1080p because title contains one of these blacklisted words: [fre french ita italian]

2020/10/28 20:34:21 [Recovery] 2020/10/28 - 20:34:21 panic recovered:
GET /v1/torrents/find_for_movie?imdb_id=tt11656172&title=Hard%20Kill&year=2020&min_quality=0 HTTP/1.1
Host: localhost:8080
Accept: /
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Origin: http://192.168.1.102:3000
Referer: http://192.168.1.102:3000/movie
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36

runtime error: invalid memory address or nil pointer dereference
/usr/lib/go-1.13/src/runtime/panic.go:199 (0x44d58f)
panicmem: panic(memoryError)
/usr/lib/go-1.13/src/runtime/signal_unix.go:394 (0x44d3e0)
sigpanic: panicmem()
/home/ubuntu/projects/iceetime/internal/app/http/torrents.go:268 (0xa244d7)
(*HTTPHandler).addTorrentsGroup.func6: "error": err.Error(),
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa03037)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-contrib/[email protected]/sessions.go:52 (0xa1ef93)
Sessions.func1: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa03037)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:83 (0xa14907)
RecoveryWithWriter.func1: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa03037)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0xa13d73)
LoggerWithConfig.func1: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa03037)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:409 (0xa0c113)
(*Engine).handleHTTPRequest: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:367 (0xa0b9c7)
(*Engine).ServeHTTP: engine.handleHTTPRequest(c)
/usr/lib/go-1.13/src/net/http/server.go:2802 (0x6bf9f7)
serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/lib/go-1.13/src/net/http/server.go:1890 (0x6bbbdb)
(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/lib/go-1.13/src/runtime/asm_arm64.s:1128 (0x46432b)
goexit: MOVD R0, R0 // NOP

[GIN] 2020/10/28 - 20:34:21 | 500 | 127.421574ms | 127.0.0.1 | GET "/v1/torrents/find_for_movie?imdb_id=tt11656172&title=Hard%20Kill&year=2020&min_quality=0"

Frontend server log:

Compiled with warnings.

./src/components/Torrents/NewTorrent.js
Line 1:17: 'useState' is defined but never used no-unused-vars

./src/components/VideojsPlugins/videojs-quality-selector/src/js/components/QualityOption.js
Line 1:1: 'use strict' is unnecessary inside of modules strict

./src/components/VideojsPlugins/videojs-quality-selector/src/js/components/QualitySelector.js
Line 1:1: 'use strict' is unnecessary inside of modules strict

./src/components/VideojsPlugins/videojs-quality-selector/src/js/util/SafeSeek.js
Line 1:1: 'use strict' is unnecessary inside of modules strict

./src/components/VideojsPlugins/videojs-quality-selector/src/js/middleware/SourceInterceptor.js
Line 1:1: 'use strict' is unnecessary inside of modules strict

./src/components/VideojsPlugins/videojs-quality-selector/src/js/events.js
Line 1:1: 'use strict' is unnecessary inside of modules strict

./src/components/VideojsPlugins/videojs-quality-selector/src/js/index.js
Line 1:1: 'use strict' is unnecessary inside of modules strict

./src/lib/IceetimeAPI.js
Line 29:3: Duplicate name 'GetTorrentByInfoHash' no-dupe-class-members

./src/components/TorrentStream/index.js
Line 2:10: 'Redirect' is defined but never used no-unused-vars
Line 10:8: 'Torrents' is defined but never used no-unused-vars

./src/components/VideojsPlugins/DurationFromServer/index.js
Line 2:10: 'TorrentsAPI' is defined but never used no-unused-vars
Line 15:9: 'plugin' is assigned a value but never used no-unused-vars

./src/pages/torrents.js
Line 2:8: 'PropTypes' is defined but never used no-unused-vars
Line 12:8: 'TorrentStream' is defined but never used no-unused-vars
Line 13:10: 'result' is defined but never used no-unused-vars

./src/App.js
Line 2:8: 'logo' is defined but never used no-unused-vars
Line 13:50: 'Link' is defined but never used no-unused-vars

./src/pages/movies.js
Line 35:21: Expected '===' and instead saw '==' eqeqeq
Line 62:7: 'selectedMovie' is assigned a value but never used no-unused-vars

./src/pages/search.js
Line 3:8: 'Button' is defined but never used no-unused-vars
Line 4:8: 'VideoPlayer' is defined but never used no-unused-vars
Line 35:30: 'resp' is assigned a value but never used no-unused-vars

./src/pages/movie.js
Line 62:19: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

Add pagination in search and browsing pages

The backend provides a page query parameter as well as a total number of pages for browsing and searching in response. Let's actually use those and create proper pagination in the frontend.

See #33

Unhandled Rejection (TypeError): Cannot read property 'duration' of undefined

300 MB from the movie has been downloaded.. But i can't watch it on the frontend client

Error on frontend client:

Unhandled Rejection (TypeError): Cannot read property 'duration' of undefined
DurationFromServer.getDuration
src/components/VideojsPlugins/DurationFromServer/index.js:67
64 | this.infoHash,
65 | this.fileIndex
66 | );

67 | return plugin.setCachedDuration(url, metadata.format.duration);
68 | }
69 | }
70 |

Error on backend server:

adata?url=http://localhost:8080/v1/torrents/torrent/9c5b54f0d757d69596d9f5422cb4b63cb40279ea/stream/0"
2020/11/01 18:05:43 WARNING: Could not format time string, falling back to 0
2020/11/01 18:05:43 [-ss 00:00:00 -i http://localhost:8080/v1/torrents/torrent/9c5b54f0d757d69596d9f5422cb4b63cb40279ea/stream/0 -f ismv -c:v libx264 -c:a libmp3lame -maxrate 1G -vf scale=iw:ih -threads 0 -preset veryfast -tune zerolatency -map 0:v:0 -map 0:a:0 -movflags frag_keyframe+empty_moov]

2020/11/01 18:05:43 [Recovery] 2020/11/01 - 18:05:43 panic recovered:
GET /v1/transcoder/from_url?url=http://localhost:8080/v1/torrents/torrent/9c5b54f0d757d69596d9f5422cb4b63cb40279ea/stream/0&res=iw:ih&max_bitrate=1G HTTP/1.1
Host: localhost:8080
Accept: /
Accept-Encoding: identity;q=1, *;q=0
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Range: bytes=0-
Referer: http://192.168.1.102:3000/movie
Sec-Fetch-Dest: video
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36

runtime error: invalid memory address or nil pointer dereference
/usr/lib/go-1.13/src/runtime/panic.go:199 (0x44d58f)
panicmem: panic(memoryError)
/usr/lib/go-1.13/src/runtime/signal_unix.go:394 (0x44d3e0)
sigpanic: panicmem()
/usr/lib/go-1.13/src/os/exec.go:159 (0xa34c4f)
(*ProcessState).Sys: return p.sys()
/usr/lib/go-1.13/src/os/exec.go:159 (0xa34c4c)
(*ProcessState).Sys: return p.sys()
/home/ubuntu/projects/iceetime/internal/app/http/transcoder.go:56 (0xa34c44)
(*HTTPHandler).addTranscoderGroup.func1: status := cmdFF.ProcessState.Sys().(syscall.WaitStatus)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa10a27)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-contrib/[email protected]/sessions.go:52 (0xa2c983)
Sessions.func1: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa10a27)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:83 (0xa222f7)
RecoveryWithWriter.func1: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa10a27)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0xa21763)
LoggerWithConfig.func1: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa10a27)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:409 (0xa19b03)
(*Engine).handleHTTPRequest: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:367 (0xa193b7)
(*Engine).ServeHTTP: engine.handleHTTPRequest(c)
/usr/lib/go-1.13/src/net/http/server.go:2802 (0x6bfb67)
serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/lib/go-1.13/src/net/http/server.go:1890 (0x6bbd4b)
(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/lib/go-1.13/src/runtime/asm_arm64.s:1128 (0x46432b)
goexit: MOVD R0, R0 // NOP

[GIN] 2020/11/01 - 18:05:43 | 500 | 6.561713ms | 127.0.0.1 | GET "/v1/transcoder/from_url?url=http://localhost:8080/v1/torrents/torrent/9c5b54f0d757d69596d9f5422cb4b63cb40279ea/stream/0&res=iw:ih&max_bitrate=1G"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4d147c]

goroutine 30025 [running]:
os.(*Process).signal(0x0, 0xdda900, 0x13019a0, 0x0, 0x0)
/usr/lib/go-1.13/src/os/exec_unix.go:56 +0x24
os.(*Process).Signal(...)
/usr/lib/go-1.13/src/os/exec.go:131
os.(*Process).kill(...)
/usr/lib/go-1.13/src/os/exec_posix.go:59
os.(*Process).Kill(...)
/usr/lib/go-1.13/src/os/exec.go:116
github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTranscoderGroup.func1.1(0x40002cc3c0, 0x40000d6f20)
/home/ubuntu/projects/iceetime/internal/app/http/transcoder.go:50 +0x80
created by github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTranscoderGroup.func1
/home/ubuntu/projects/iceetime/internal/app/http/transcoder.go:48 +0x464
exit status 2

Unhandled Rejection (TypeError): Cannot read property 'duration' of undefined

300 MB from the movie has been downloaded.. But i can't watch it on the frontend client

Error on frontend client:

Unhandled Rejection (TypeError): Cannot read property 'duration' of undefined
DurationFromServer.getDuration
src/components/VideojsPlugins/DurationFromServer/index.js:67
64 | this.infoHash,
65 | this.fileIndex
66 | );

67 | return plugin.setCachedDuration(url, metadata.format.duration);
68 | }
69 | }
70 |

Error on backend server:

adata?url=http://localhost:8080/v1/torrents/torrent/9c5b54f0d757d69596d9f5422cb4b63cb40279ea/stream/0"
2020/11/01 18:05:43 WARNING: Could not format time string, falling back to 0
2020/11/01 18:05:43 [-ss 00:00:00 -i http://localhost:8080/v1/torrents/torrent/9c5b54f0d757d69596d9f5422cb4b63cb40279ea/stream/0 -f ismv -c:v libx264 -c:a libmp3lame -maxrate 1G -vf scale=iw:ih -threads 0 -preset veryfast -tune zerolatency -map 0:v:0 -map 0:a:0 -movflags frag_keyframe+empty_moov]

2020/11/01 18:05:43 [Recovery] 2020/11/01 - 18:05:43 panic recovered:
GET /v1/transcoder/from_url?url=http://localhost:8080/v1/torrents/torrent/9c5b54f0d757d69596d9f5422cb4b63cb40279ea/stream/0&res=iw:ih&max_bitrate=1G HTTP/1.1
Host: localhost:8080
Accept: /
Accept-Encoding: identity;q=1, *;q=0
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Range: bytes=0-
Referer: http://192.168.1.102:3000/movie
Sec-Fetch-Dest: video
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36

runtime error: invalid memory address or nil pointer dereference
/usr/lib/go-1.13/src/runtime/panic.go:199 (0x44d58f)
panicmem: panic(memoryError)
/usr/lib/go-1.13/src/runtime/signal_unix.go:394 (0x44d3e0)
sigpanic: panicmem()
/usr/lib/go-1.13/src/os/exec.go:159 (0xa34c4f)
(*ProcessState).Sys: return p.sys()
/usr/lib/go-1.13/src/os/exec.go:159 (0xa34c4c)
(*ProcessState).Sys: return p.sys()
/home/ubuntu/projects/iceetime/internal/app/http/transcoder.go:56 (0xa34c44)
(*HTTPHandler).addTranscoderGroup.func1: status := cmdFF.ProcessState.Sys().(syscall.WaitStatus)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa10a27)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-contrib/[email protected]/sessions.go:52 (0xa2c983)
Sessions.func1: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa10a27)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:83 (0xa222f7)
RecoveryWithWriter.func1: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa10a27)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0xa21763)
LoggerWithConfig.func1: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161 (0xa10a27)
(*Context).Next: c.handlersc.index
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:409 (0xa19b03)
(*Engine).handleHTTPRequest: c.Next()
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:367 (0xa193b7)
(*Engine).ServeHTTP: engine.handleHTTPRequest(c)
/usr/lib/go-1.13/src/net/http/server.go:2802 (0x6bfb67)
serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/lib/go-1.13/src/net/http/server.go:1890 (0x6bbd4b)
(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/lib/go-1.13/src/runtime/asm_arm64.s:1128 (0x46432b)
goexit: MOVD R0, R0 // NOP

[GIN] 2020/11/01 - 18:05:43 | 500 | 6.561713ms | 127.0.0.1 | GET "/v1/transcoder/from_url?url=http://localhost:8080/v1/torrents/torrent/9c5b54f0d757d69596d9f5422cb4b63cb40279ea/stream/0&res=iw:ih&max_bitrate=1G"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4d147c]

goroutine 30025 [running]:
os.(*Process).signal(0x0, 0xdda900, 0x13019a0, 0x0, 0x0)
/usr/lib/go-1.13/src/os/exec_unix.go:56 +0x24
os.(*Process).Signal(...)
/usr/lib/go-1.13/src/os/exec.go:131
os.(*Process).kill(...)
/usr/lib/go-1.13/src/os/exec_posix.go:59
os.(*Process).Kill(...)
/usr/lib/go-1.13/src/os/exec.go:116
github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTranscoderGroup.func1.1(0x40002cc3c0, 0x40000d6f20)
/home/ubuntu/projects/iceetime/internal/app/http/transcoder.go:50 +0x80
created by github.com/diericx/iceetime/internal/app/http.(*HTTPHandler).addTranscoderGroup.func1
/home/ubuntu/projects/iceetime/internal/app/http/transcoder.go:48 +0x464
exit status 2

Render front end with Go in prod, yarn for dev

I found a very interesting idea in this blog post
https://www.freecodecamp.org/news/how-to-build-a-web-app-with-go-gin-and-react-cffdc473576/

What we can do is run react locally for development, but render the static react files with Go in production. Here are the basic steps necessary to achieve this:

  • Put the frontend dir in backend then just move everything out of the backend dir

  • Add flag to backend specifying environment (dev or prod)

  • If we are in prod env, serve static frontend files from ./frontend/build

  • Build the static node files in the docker image (already exists in /frontend so just remove the nginx stuff and replace with go serving with gin)

  • Possibly remove the static env var stuff from frontend and just default to hitting the same domain it's serving from. In dev we can specify a var

Add TMDB bindings in go

Before we can add any search functionality we need to incorporate TMDB bindings to get search results and metadata for movies.

  • Add TMDB API key (tmdb_api_key in toml, TMDBAPIKey in Go) to TOML config
  • Add a new repo in internal/app/repos/tmdb which takes in the TMDBAPIKey string and implements these functions

Convert all front end to Go/Gin and phase out Node/React

After working on a POC for the torrent front end, I'm realizing using Node/React for the front end is just overkill. It will be much easier for development and usability to just use Gin/Templates.

With this done we will also move to one dockerfile which will be awesome for usability.

jackett toznab

How to add multiple jackette toznabs into the toml file.

Many thanks.

Update config-example.toml

I get this a bunch of times then exists:

ERROR: Invalid config bevy | Release Service is invalid: Quality 0 is invalid: bevy | {Name:720p Regex:720 MinSize:5e+08 MaxSize:1e+10 MinSeeders:2 Resolution:1280x720 SeederScoreExpr: SizeScoreExpr:} bevy | Seeder score function cannot be emptyERROR: Invalid config

Add better functions for movie grabbing

Currently we just sort by seeders and make sure we aren't going outside our strict min/max for size. We should have more robust functions here that let us really pinpoint what we want.

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.