GithubHelp home page GithubHelp logo

aunefyren / plex-wrapped Goto Github PK

View Code? Open in Web Editor NEW
294.0 5.0 22.0 6.02 MB

Website based application that summarizes Plex statistics from a given period and displays it in a nice format. Similar to the Spotify Wrapped concept.

CSS 4.36% JavaScript 46.67% HTML 9.56% Dockerfile 0.08% Go 39.33%
plex tautulli statistics website api summary wrapped year docker go self-hosted visualization

plex-wrapped's Introduction

Wrapperr

Github Stars Github Forks Docker Hub Pulls Newest Release Go Version Wiki hyperlink



Donate

Like the project? Have too much money? Buy me a coffee or something! β˜•οΈ



Introduction - What is this?

Many platforms have periodic recaps of user data and statistics, which can be fun and interesting to look at. Typically these statistics are released on a website in December, like Spotify Wrapped.

Wrapperr is a website-based application for pulling Plex user statistics within a set timeframe (sourced from Tautulli). The statistics are gathered and processed into a statistics summary. Then the website displays this in a fun, interactive format. Yes, you need Tautulli to have been running beforehand and currently for this to work. That is where the data is stored, Wrapperr just processes and displays it.


Image showing the introduction section of Wrapperr.


Features

  • Custom timeframes for statistics
  • Plex Auth for login
  • Supports multiple Tautulli servers
  • Friendly, dynamic presentation of statistics with nice illustrations
  • Customizable text options
  • Customizable appearance/results
  • Statistics for movies, shows & music
  • Caching of Tautulli results
  • Admin interface for configuration (with regular and HTTP Basic login)
  • Pre-caching of results before user interaction
  • Shareable links with expiration

Image showing the show section of Wrapperr.


Credit


Image showing the server-wide section of Wrapperr.


Explanation - How does it work?

This is a web-based platform. It gathers and displays statistics gathered from the Tautulli API (application programming interface). Install Wrapperr, configure the essential options, and Wrapperr will do the rest. Based on your exact configuration, Wrapperr will gather unique statistics for each user interacting with the application and display it in a nice format.

Within Wrapperr you configure a timeframe, from date-time A to date-time B. This is the timeframe from which the statistics are created. One could for instance have a wrap-up of multiple years of Tautulli data or just a week. If enabled, Wrapperr will also verify the user with their Plex login to ensure personal data is kept private.

Most text is customizable through the Wrapperr admin interface which allows for regional translation. Certain statistics can be disabled and enabled based on relevance/interest. Users can, if enabled, generate random URLs that can be shared between friends who want to see each other's statistics.



Instructions - How do I install this?

There are two main ways. Docker information is in the wiki.



Download and start

There are multiple ways to install Wrapperr. The easiest is just to download the latest release from the Release Page which matches your operating system, move all the content to a directory, and start the wrapperr application located within the release. It should start right up, perhaps triggering some operating system or firewall warnings.



Build with Go

If you want to build Wrapperr yourself instead of downloading a release, you can download whatever version/tag/branch/release of the source code you want, and place the files in a directory. With Go installed, from the Wrapperr directory, run the following commands to build and execute Wrapperr:

$ go build
$ ./wrapperr

Note, if building on another operating system, the executable could have a different name. Such as wrapperr.exe on Windows.



Head to the website

If Wrapperr is successfully started, it should be accessible on http://localhost:8282. From there you can click on admin in the footer at the bottom, or go to /admin in the URL. From there you can configure everything about Wrapperr in the different sections of the menu.



Essential configuration options

A couple of configuration options are necessary on the admin page for Wrapperr to function. First of all, Tautulli connection details. There is a test button available on the page to ensure you have entered the correct details. The second one is the time zone option on the Wrapperr Settings page.

It is recommended to keep Cache results for later use enabled on the Wrapperr Settings page, and head to the Caching page after configuration. Click the Cache button and wait for the caching to finish. This ensures a good, quick user experience.



Wrap away!

Wrapperr should now be functional. Based on your settings, you can now either search with username/e-mail or log in with Plex on the front page. Continue tweaking on the admin menu to get the appearance/language you desire.



More documentation

Docker, TLS, setup information and more can be found in the documentation at the Wiki!

Wiki hyperlink



Need help?

If you have any issues feel free to open an issue here on GitHub. I am always trying to improve the project. If I can't, many people on several forums (including /r/plex) might be able to assist you.

Have fun.

plex-wrapped's People

Contributors

aunefyren avatar etsweeney avatar jchris246 avatar joshnotwright avatar mchangrh 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  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

plex-wrapped's Issues

Server-wide statistics shows NaN total seconds of playback

The container with total server-wide playback shows the following text:

All the different users combined spent
40 days, 12 hours and 28 minutes
watching movies.

All the different users combined spent
80 days, 23 hours and 39 minutes
watching shows.

That is
NaN seconds
of content!

docker latest tag

It appears that you attempted to update the latest tag for the plex-wrapped docker image however it still has the same digest as 2.0.0.

Option to exclude libraries

I have a music library tracked in Tautulli that isn't shared with anyone else, but everyone gets an empty music section in Wrapped. It would be good to be able to exclude certain libraries from Wrapped stats without having to remove them from Tautulli

Issue, Wrapperr is not configured on new docker pull

Hi,

Each time I pull a new version of docker image and I restart my container the config is totally wiped and I have to totally reconfigure it

Here's my compose :

version: '3.3'
services:
  wrapperr:
    ports:
      - '8282:8282'
    container_name: wrapperr
    image: 'aunefyren/wrapperr:latest'
    volumes:
      - './config:/var/www/html/config'
    labels:
      - com.centurylinklabs.watchtower.enable=true
      - autoheal=true
    healthcheck:
     test: ["CMD-SHELL", "curl --connect-timeout 15 --silent --show-error --fail http://127.0.0.1:8282 || exit 1"]
     interval: 1m30s
     timeout: 10s
     retries: 3

With docker exec chmod 0777 ./config
My log file wrapped.log is empty btw

Add Dropdown For Timezones

Sorry if this was brought up elsewhere. Just started using this app and noticed that you have a link to wikipedia for timezones - could you just put that into a dropdown list for the user to select from?

Server-Wide Statistics Displays "NaN Seconds"

Platform: Docker behind Nginx reverse proxy (issue is present when bypassing reverse proxy as well)

Expected behavior: Server-wide statistics area should be displaying the total number of seconds all users combined spent watching content.

Actual behavior: Server-wide statistics area is displaying "That is NaN seconds of content!"

Are there any logs I can provide? I checked the browser console but all I see is:
my.domain/:1 Error handling response: TypeError: Cannot read properties of undefined (reading 'takeRecords') at Function.e.closeListeners (chrome-extension://jkgeppojddflfhbfhjgapbcdnabegmdg/content-script.js:1:5858) at chrome-extension://jkgeppojddflfhbfhjgapbcdnabegmdg/content-script.js:1:3858

Plex OAuth to get userid

This would prevent someone from reviewing their own wrapped summary, grabbing other users ID's and re-running to see what other people have watched.

Cannot configure wrapper on Docker, http://localhost/admin just has title "Wrapper Setup" and "Wrapper | Admin | Github" at bottom with nothing in between

I haven't used Wrapper in a while, the last time I succesfully logged in and checked stats was probably back in Feb. However, recently, I tried to log in and couldn't, so I removed the Wrapper container, then image, then redownloaded and tried to launch Wrapper by running the command I've always used:

docker run -p '12380:80' --name 'wrapperr' --restart unless-stopped aunefyren/wrapperr:latest

When I go to http://localhost:12380/admin, except for the title and the links at the bottom, the page is blank. I have tried 4 different browsers (FF, Chrome, Edge, Vivaldi) and they all display the same. I have tried clearing all cookies and cache, I have tried restarting Docker.
I went into /config and saw that both admin.json and config.json have 0 bytes. Is that normal?

Screenshot 2022-07-04 110406

[Issue] After caching, nothing shows when pressing "Unwrap"

[Issue] After caching, nothing shows when pressing "Unwrap"

Describe the bug
When I press "unwrap" after updating to the latest version of wrapperr, nothing appears.
After cloning the most recent version, creating a new admin password, setting up Tautulli, and creating the cache, nothing appears after logging in and pressing "Unwrap."
It only displays the "new year, new statistics" page, followed by the "goodbye, stay safe" page, with no statistics.
This was not the case in the previous edition, so I'm not sure what happened.
I deleted the entire contents of the previous folder, before "upgrading" to the new version. Reproducing steps below (atleast for me)..

To Reproduce

  1. Create a quick domain-setup, with /etc/nginx/sites-enabled/wrapped.domain.com.conf and enable PHP.
  2. The wrapped.domain.com.conf file looks like this
  3. cd /var/www/wrapped.domain.com
  4. sudo git clone https://github.com/aunefyren/wrapperr.git
  5. sudo chown -R www-data:www-data wrapperr/
  6. sudo chmod -R 0777 /var/www/wrapped.domain.com/wrapperr/config
  7. I configured an admin login/password
  8. I configured my Tautulli and confirmed it is working (green Test Connection prompt)
  9. I chose the pre-cache option, 50 days
  10. Waited for the cache to complete
  11. Confirmed that the cache.json file in /var/www/wrapped.domain.com/wrapperr/config was created (size is about 5-6mb after pre-cache)
  12. Restarting nginx, sudo service nginx restart
  13. Login using the "Sign in using Plex" prompt
  14. After logging in, I press "Unwrap", and it shows no stats. Only the welcome and goodbye page(s).
  15. Be sad: https://i.imgur.com/7FaNrXm.png

Expected behavior
It should work like last time πŸ₯²

Operating System
Ubuntu 21.10

Feature Request

I manage 6 servers located in various locations and would love to have a single webpage to view stats from all of them. I have tautulli running on each server and would love a central place to aggregate the stats.

Port

I swear I'm not trying to be a bother, but I'm already using port 80 and when I change the port (using Docker Compose), I can't ever get the landing page to connect.

Is it possible to change the port, and if so, how? I planned on using a reverse proxy. Thanks!

Wrapper is not configured?

image

what have i done wrong?

Installed on unraid

logs:
Wrapperr
2022-03-24 11:03:12 - get_plex_wrapped_version.php - ID: unknown - Retrieved Wrapperr version.
2022-03-24 11:03:27 - get_login_url.php - ID: unknown - Wrapperr is not configured.
2022-03-24 11:03:31 - get_login_url.php - ID: unknown - Wrapperr is not configured.
2022-03-24 11:04:13 - get_login_url.php - ID: unknown - Wrapperr is not configured.
2022-03-24 11:04:37 - get_plex_wrapped_version.php - ID: unknown - Retrieved Wrapperr version.
2022-03-24 11:04:38 - get_login_url.php - ID: unknown - Wrapperr is not configured.
2022-03-24 11:06:26 - get_login_url.php - ID: unknown - Wrapperr is not configured.

Login via Safari on iOS and Chrome on Android doesn’t work

On Safari in iOS 15, clicking "login with Plex" just says "loading" and doesn't open the modal to authenticate.

On Chrome in Android, it opens the authentication window, but then authentication fails and brings you back to the login screen.

Authentication works fine on desktop.

Sharing and Managed Users

Hey @aunefyren! Saw your post on reddit and had to spin up my own instance, this is great!

I ran into the issue of not being able to see a managed user. I saw your suggestion to turn off plex auth, which worked but then I couldn't create a shareable URL... is there a way to have both?

Thanks!

Reverse Proxy with subfolder not working (API response cant be parsed, Admin interface not working)

my nginx proxy conf:

location ^~ /wrapperr/ {

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-Host  $http_host;
        proxy_set_header Host              $http_host;
        proxy_pass                         http://192.168.1.16:8282/;
}

my relevant wrapper config:

	"wrapperr_version": "v3.1.0",
	"timezone": "Europe/Berlin",
	"application_name": "wrapperr",
	"application_url": "my-domain.com",
	"use_cache": true,
	"use_logs": true,
	"wrapperr_root": "wrapperr",
	"wrapperr_port": 8282,

Plex Auth doesnt work because it tries to

index.js:253          POST https://192.168.1.16/api/validate/plex-auth 404

instead of https://192.168.1.16/wrapperr/api/validate/plex-auth

image

same for the whole admin interface:

image

POST https://192.168.1.16/api/get/wrapperr-version 404

as far as I can tell from main.go, you are not using your read-im WrapperrRoot var anywhere and all your api calls are hardcoded via the go router.

https://github.com/aunefyren/wrapperr/blob/main/main.go#L121

I think this could be fixed in this line but I cant test it currently sadly.

Users don't receive data if they have a custom username

I found an error when users try to type in their email but they have a custom plex username that is not default to their email account it will just keep searching. It works fine for people who don't use custom emails.

Is there a way to search by Plex username rather than plex email? Also any way to get local managed user stats as well??

Thank you!

Cache not working

I just upgraded to release v3.0.1 but i'm having an issue with the cache. I've run a manual cache update but when I unwrap it states in the log "No Wrapperr links found for" my username. It then recaches and display results but if I then immediately return and unwrap again it shows the same message in the log and recaches again. I've attached the relevent section from the logs. Any idea what I got wrong? Thanks
log.txt

Config Not Persisting

Hello!

I'm trying to setup a new Docker container for this program(I had it running as a PHP app in Nginx last year), but I'm running into some issues.

I'm running the container on a Synology NAS - the issue I'm running into is that the config seems to overwrite itself, and I'm also having intermittent issues logging in. I can usually create an admin account after creating a new container, but then if I try to log into it I keep getting an auth error unless I clear my browser's cache a few times.

I confirmed the permissions are correct(and ran it as root temporarily to rule that out), tried with the networking on the host, and also tried passing through the port directly - for some reason it seems like its creating a ton of .replaced files in the volume but something is going haywire with it actually committing and using the new info.

These are the files I'm seeing in the mounted volume:
container files

And this should be the log - this is from a fresh install where I'd tried to make a new admin and configure Tautillu.

One thing to mention - I do have PiHole running on my network and its strict on blocking stuff, so if there are external dependencies I might need to allow their domains.

Any and all help would be appreciated, I'm not really sure what the issue could be at this point. I have managed to get it to work and show my own stats once, but when I checked the settings afterwards everything was null again.

Working behind haproxy

I want to make wrapperr available to my users. I have set everything up in haproxy. However, when I try to browse to my URL I get a 503 Service unavailable error.

I am wondering if I am missing something that is preventing me from getting it working. I have multiple other services available via HAproxy.

Thanks for your help.

Wrapper stuck in loading loop

Had the app installed on unraid xmas last year and loved it. Have redownloaded this year, and the webui is stuck on the spinning hourglass with a "loading" underneath, docker logs say "Starting Wrapperr on port: 8282." Installed on unraid. Only one thing in dev tools on browser looks off to me but im also no web developer
image

Can't set timezone in setup

Every attempt to save the wrapperr config results in an error that reads "Given time zone is invalid." I've tried multiple different zones with no luck.

Admin panel shows default values but doesn't use them

It's probably partially that I'm just dumb, but I assumed that the grayed-out 8181 in the port box meant it would try to connect on that port. I finally figured it out, but you might look into changing how that works.

[Bug?] "βœ“ Plex Wrapped" greyed out

Hey

I installed wrapperr by:

  1. Create a quick domain-setup, with /etc/nginx/sites-enabled/wrapped.domain.com.conf and enable PHP.
  2. The wrapped.domain.com.conf file looks like this
  3. cd /var/www/wrapped.domain.com
  4. sudo git clone https://github.com/aunefyren/wrapperr.git
  5. sudo mv wrapperr/ html/
  6. sudo chown -R www-data:www-data html/
  7. sudo chmod -R 0777 /var/www/wrapped.domain.com/html/config
  8. I configured an admin login/password
  9. I configured my Tautulli and confirmed it is working (green Test Connection prompt)
  10. I chose the pre-cache option, 50 days
  11. Waited for the cache to complete
  12. Confirmed that the cache.json file in /var/www/wrapped.domain.com/html/config was created (size is about 5-6mb after pre-cache)
  13. Restarting nginx, sudo service nginx restart
  14. Trying to login using the "Sign in using Plex" prompt
  15. After logging in, I get this: https://i.imgur.com/wYFJFt6.png
  16. "βœ“ Plex Wrapped" greyed out

Can't really figure out if I did anything wrong. It worked before using the Plex OAuth login, so I'm not sure why it doesn't work now.

Other info

  1. Tautulli is v2.8.0 (2021-12-15)
  2. Using the "Sign in using Plex" prompt, gives a rather unpleasant "warning" message:
    https://i.imgur.com/NigpkMQ.png

List of possible {xxxxxxx} we can use?

Apologies if this is already available and I've missed it.

Looking for an active list of all types or {movie}, {name}, etc that we can use. Was hoping to change the Plex username to the Tautulli name I've set instead for users after Plex force changed everyone's to a weird formula in the last year.

Feature Request for server rankings

I was hoping that you add the number of plays or time spent watching on the leader board. It could show how close or far everyone was away from each other.

Option to change header text in each section

I love the new changes! I am glad to have the ability to turn off buddies and leaderboards, but the server-wide stats have a header that's hard coded to reference seeing usernames on a list ("It's okay to feel shame if you are on the list.") and it would be nice to be able to change that text. Tokenizing the text would also make translation possible!

Mobile Client Not Working

Issue: When accessing the application from a mobile client, after clicking 'Sign in using Plex' it gets stuck at a 'Loading...' and never asks for plex login.

Using Docker installed via Unraid.

API response can't be parsed on Plex Sign-in

I recently updated to the latest container image in Docker, however, Plex Sign-in appears to no longer be working.

My settings show the connection with Tautulli as successful, but the app appears to no longer be initiating requests via Plex Sign-in. I don't see any error messages in the logs to indicate what might be the issue here.

Connecting to gui/setup on port 8282

Greetings!

Thanks in advanced for any assistance/the awesome app!

Attempting to install and run within Docker running on Unraid. I have installed the wrapperr docker container and left everything defaulted as those ports are free on my system.

The container runs and checking the log see it states no config found creating config and wrapperr is started on port 8282.
However navigating to localip:8282 can't seem to connect.
I've confirmed no other contain is using 580 or port 8282 but can't seem to connect or pull up /admin.

I did look in the /appdata location as well and see no config files are being created.

Thanks again and apologizes for what might be a basic question!

-Cheers

Not getting any server-wide statistics when user has zero plays

I have an "admin account" for Plex where I log in and do everything on the server, and then I made a secondary account for viewing.

When logging into Wrapperr via Plex sign-on on my admin account, the only thing I get in the wrap up is "you watched zero movies," "you watched zero TV shows."

Tried it with the secondary account and it works fine.

Results not showing up for any date range

Hi,

I've been trying to get 2022 statistics to show up on the wrapped results page. The Tautulli connection is successful, I've changed the date range in the Wrapperr settings, cleared the cache and re-cached the Tautulli data several times, but nothing appears to be working.

Here is what the results page looks like when trying to view the wrapped page:

image

Any help you can provide would be greatly appreciated!

Thanks

[Docker] Config directory should be on the host as a volume to persist

Hello! This is a very very cool project!

When I try to put the config directory into an external volume, your container can't read it.

I put this in my compose yaml

#    volumes:
#      - ./plex-wrapped/config:/var/www/html/config

But then the server setup and account creation sections don't load. When I set it up with the recommended docker config, it came right up. But if the container is recreated, then all the settings are lost. By placing the config files on an external volume, then they can persist even when the container is recreated.

Send Email

Hi,

It would be an option to make sure that it sends each plex user a recap every x time (which can be configured)

Example, send an email once a week, per month, with all stats as spotify.

Thanks for your soft.

API response can't be parsed.

Just fired up docker compose container containing Plex Wrapped (small tweak with outside port of 8090 as the port 80 was already in use), configured it via web UI.

Good to know: I have two instances of tautulli (one in docker via docker-compose and one outside of docker like "on bare metal").

Plex Wrapped didn't even accept tautulli's (instance that is on bare metal) API so i tried one that's dockerized. When i clicked the test button, it didn't turn red which is... good i think?
Then i saved it, configured the timeline i want to wrap and tried to enter my email adress. After some time of sand clock animation it just thrown error in the title.

in docker logs there were only POST and GET requests...

Any idea how to fix this?

times played for movies is wrong

On the List Top Movies shows a number of movies played, but it's wrong.

for example:
image

but this is what tautulli actually shows
Cruella 1 play
image
Black Window (none)
image
Tenet 4 plays.
image

and so on.

Annual summary for Audio Books

Hey sorry I am fairly amateurish to this but I am trying to create an end of year summary for my user of all the audiobooks they have listened too over the year. Wrapper pulls the top 10 but I really need the whole list, ideally I could include the labum art like I do for the newsletter and a synopsis from the plex database. Then send this out as a newsletter, or at least let me generate urls that I can send out.

Any help appreciated.

Also I tried to use {album_count} for total albums played but didn't work, is there a list of tags?

Generate non-guessable URLs to distribute to each user

I think some of my users are skeeved out enough by having this kind of watch history, but being able to look up each other's history probably feels worse.

It would be nice to be able to show them their stats without making it possible for anyone to look up anyone else's via email address or username guessing. A unique URL like https://wrapped.myplexserver.com/fc863582-41f7-4877-a11b-90171f357bae would take you to a single user's wrapped, and still allow them to share it if they care to.

Option to adjust data pulled from Tautulli

Hey there, love this project! Lots of fun to share this data with friends and family.

One thing I was wondering was if it was possible to change which data is pulled for "top movies." Currently, it is pulling from Play Duration, and not Play Count.

For example, Justice League (14 plays) was my "top movie" according to this project, because it pulls amount of time watched for the leaderboard. When really, Black Widow (21 plays) should be the "winner" as it was played more, but Justice League was a much longer movie.

Might be too late into the year to make it a consideration, just thought it was something to bring up and see if it was just me that would like the option.

Most watched episode bug?

My wrap shows I've watched an episode of tv 15 times for a total of 11h9m. I checked Tautulli and there is only one play logged.

Not sure what could be causing it.

image
Screenshot from 2022-12-08 15-45-47

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.