Giter Site home page Giter Site logo

ninthwalker / nowshowing Goto Github PK

View Code? Open in Web Editor NEW
72.0 7.0 9.0 16.83 MB

Generates an email and web page of Plex recently added content

License: MIT License

HTML 18.70% Ruby 28.95% CSS 5.12% JavaScript 18.31% PHP 28.57% Shell 0.02% Dockerfile 0.33%
plex docker unraid thetvdb email reports now-showing

nowshowing's Introduction

NowShowing v2

Docker Automated build Build Passing

Introduction

The NowShowing docker provides a summary of new media that has recently been added to Plex, giving the Plex owner the option of delivering the information in two ways:

  1. An email summary sent to all or selected users of the Plex Server
  2. A web page for users to visit

Description / Background

NowShowing is the successor of the popular plexReport docker. The original brainchild of bstascavage. Further developed by NinthWalker & enhanced by GroxyPod, NowShowing adds additional improvements and features in a friendly, easy to install docker.

New in v2:

Complete code rewrite with tons of new features!

  • Same great Email/webpage for Plex recently added as v1
  • All new Web Interface for settings and customization
  • Library Filtering!
  • Movie/TV Trailers
  • Tautilli Statistics integration
  • New user Setup Wizard
  • Announcement Emails
  • Web based Log Viewer
  • Easy Plex token retrieval
  • Most email providers supported
  • BCC users instead of multiple emails
  • Web tools including On-Demand and Test reports

Supported Platforms

  • Docker (Windows or Linux based) See Wiki
  • unRAID v6+

Supported Email Clients

Supported Plex Agents

  • Plex Movie
  • TheMovieDB
  • TheTVDB

Prerequisites

  1. Plex
  2. Docker
  3. Plex Movie or TheMovieDB set as your Agent for Movie sections on the Plex server
  4. TheTVDB set as your Agent for TV sections on the Plex server
  5. An Email account that supports SSL SMTP

Installation on unRAID

See unRAID Wiki

Installation on other Docker platforms

See Other Docker platforms Wiki

Advanced settings, FAQ, Command-line options & other questions:

See Github Wiki

nowshowing's People

Contributors

groxypod avatar ninthwalker 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  avatar

nowshowing's Issues

Filtering Users

I don't want to send emails out to every single one of my users. Is this possible?

I thought I could change it in advances.yaml by setting:

plex_user_emails: 'no'
recipients: ['user1', 'user2']

But this still sends to everyone.

Wiki issue

You need to change

6878:6789 in option 2, to 6878:6878

admin does not exist

Hi, it's been a while since I last tried to configure NowShowing (v1). I updated the docker image, and tried to access serverip:port/admin but to no avail:

Not Found
`/admin' not found.
WEBrick/1.3.1 (Ruby/2.3.7/2018-03-28)

How can I (re)set this up properly again?

[Request] Reverse Proxy base URL

i'd like to put this behind a reverse proxy but i dont see anywhere to set a base url.

location /nowshowing/ {
    proxy_pass http://172.18.0.1:6878;
    add_header X-Frame-Options "SAMEORIGIN";
	proxy_set_header Host $host;
	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

FAQ Update

Not strictly an issue but just to let you know that I've tested this against Office365 email instead of Gmail and confirm that it definitely doesn't work with this service (doesn't like the port / security combo).

Cheers

Mark

Office 365 Support?

I'm trying to get this working with Office 365 email (Exchange Online). Here is Microsoft's documentation on getting SMTP running:

https://support.office.com/en-us/article/POP-and-IMAP-settings-for-Outlook-Office-365-for-business-7fc677eb-2491-4cbc-8153-8e7113525f6c?ui=en-US&rs=en-US&ad=US

When I replicate this in NowShowing (Port 587 and smtp.office365.com), I get the following error:

root@NAS01:~# docker exec nowshowing combinedreport -t
/usr/lib/ruby/2.3.0/net/smtp.rb:977:in `check_auth_response': 504 5.7.4 Unrecognized authentication type [redacted.namprd20.prod.outlook.com] (Net::SMTPAuthenticationError)
        from /usr/lib/ruby/2.3.0/net/smtp.rb:741:in `auth_plain'
        from /usr/lib/ruby/2.3.0/net/smtp.rb:733:in `authenticate'
        from /usr/lib/ruby/2.3.0/net/smtp.rb:568:in `do_start'
        from /usr/lib/ruby/2.3.0/net/smtp.rb:521:in `start'
        from /usr/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
        from /usr/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/message.rb:252:in `deliver!'
        from /var/lib/nowshowing/mailReport.rb:98:in `block in sendMail'
        from /var/lib/nowshowing/mailReport.rb:89:in `each'
        from /var/lib/nowshowing/mailReport.rb:89:in `sendMail'
        from /usr/local/sbin/combinedreport:386:in `main'
        from /usr/local/sbin/combinedreport:394:in `<main>'

Platform: Docker running on UnRAID 6.3.3 using latest image of NowShowing.

When I was using PlexEmail back in the day, disabling SSL was the solution for this issue, but that doesn't seem to be an option here. Any thoughts? Anything I can pull for you to help troubleshoot?

Not working with Marvel's The Punisher

Seems that NowShowing doesn't handle 404 errors from theTVDB very well:

D, [2017-11-18T15:21:38.394907 #70] DEBUG -- : Response from thetvdb for query series/329367/all/en.xml: Code: 404.
E, [2017-11-18T15:21:38.395176 #70] ERROR -- : Could not connect to thetvdb.com. Will retry in 30 seconds
D, [2017-11-18T15:22:08.395416 #70] DEBUG -- : Retry attempt: 1 for query series/329367/all/en.xml
D, [2017-11-18T15:22:08.811694 #70] DEBUG -- : Response from thetvdb for query series/329367/all/en.xml: Code: 404.
E, [2017-11-18T15:22:08.811903 #70] ERROR -- : Could not connect to thetvdb.com. Will retry in 30 seconds
D, [2017-11-18T15:22:38.812429 #70] DEBUG -- : Retry attempt: 2 for query series/329367/all/en.xml
D, [2017-11-18T15:22:39.130871 #70] DEBUG -- : Response from thetvdb for query series/329367/all/en.xml: Code: 404.
E, [2017-11-18T15:22:39.131184 #70] ERROR -- : Could not connect to thetvdb.com. Will retry in 30 seconds

It's looking for Marvel's The Punisher w/ seriesID 329367, which is wrong. The correct ID is 331980. Not sure whether it gets the ID from Plex, which would be weird because Plex has all the right metadata, or just from a search, but it shouldn't just repeatedly fail on a 404. It should retry X times and then move on.

Question: plex_user_emails or not to plex_user_emails?

I think I may be confusing myself here, but my first emailreport ran this morning, and no emails were sent out. I'm starting to wonder how I should have my advanced.yaml file set up. Here's what it looks like now:

plex:
  plex_user_emails: 'no'
mail:
  from: 'me'
  subject: 'New This Week on Plex!'
  recipients_email: ['']
  recipients: ['myusername', 'username1', 'username2']

It was my understanding that by selecting no for plex_user_emails, I could specify exact users to send to using the recipients field, instead of sending to every user I'm friends with. Is that the case? When the report ran (and I know it ran because the logs show it collecting things at the proper time), no emails were generated.

Can I have some guidance on how to set this up? do I need plex_user_emails set to yes? When I ran the report manually using docker exec nowshowing emailreport, it worked as expected, though.

Thanks!

Updating docker template in unRAID doesn't update config.yaml if the file exists

Updating the docker template to change information will not update the config.yaml file if it already exists. This needs to be changed so that the config.yaml file will be updated in the event someone wants to change their configuration.

We will need to add every possible option to the docker template in order to facilitate this.

Possible to edit css on v2

On v1 I've been using an edited version of the CSS file to change some colours to fit with my custom logos. If I use the admin interface (which is a nice addition btw!) if I make any changes then they'll automatically get overwritten if I save anything through the UI, correct?

Is this also true if I pull the latest version of the app through Docker each time?

Is there any way to 'protect' my custom changes?

User-Selectable Polling

Reviewed code to see if we can allow for user-selectable polling of recently added items. Seems do-able but requires time to be entered in seconds. This will require a method of updating the config file so it adds the new line in the event the file already exists. I'll handle the user-selectable polling rate, once complete, an enhancement request will be opened and assigned to ninthwalker for assistance with forcing config update.

Tautulli Stats

I don't have the statisitics tab? Anything special needing to be done for it?

container won't start

I get the following error on first run of the container, double checked permissions in the appdata directory I have set.

[cont-init.d] 20-setup: executing... 
/usr/local/sbin/config-setup:63:in `setServer': undefined method `empty?' for nil:NilClass (NoMethodError)
	from /usr/local/sbin/config-setup:85:in `start'
	from /usr/local/sbin/config-setup:94:in `<main>'

Any common stuff for me to try first?

Web HTTPD Not Working

Unable to load the web page for NowShowing. Doesn't look like the httpd is started within the docker.

Docker Container Report Running issue

Preface - using Cloudbox install.

installed nowshowing via Docker create

docker create --name=nowshowing \
-e PLEX_SERVER_IP=172.17.0.11 \
-e PLEX_TOKEN=XXXXXXXXXXXXXXXX \
-e SMTP_SERVER=smtp.gmail.com \
-e SMTP_PORT=587 \
-e PUID=1001 \
-e PGID=1001 \
-e VIRTUAL_HOST=nowshowing.XXXXXX.com \
-e VIRTUAL_PORT=6878 \
-e LETSENCRYPT_HOST=nowshowing.XXXXXXX.com \
-e [email protected] \
-e [email protected] \
-e EMAIL_PASSWORD=XXXXXXXX \
-p 6878:6878/tcp \
-v /opt/nowshowing:/config:rw \
-v /etc/localtime:/etc/localtime:ro \
--restart=always \
--net=cloudbox \
ninthwalker/nowshowing`

(It's also on the Bridge network but not during creation)

I am able to access the Default webpage just fine, however when attempting to send test email or combined email&webpage I get the following timeout error:

docker exec -it nowshowing emailreport -d -t 
[sudo] password for XXXXXX: 
/usr/lib/ruby/2.3.0/net/http.rb:880:in `initialize': execution expired (Net::OpenTimeout)
	from /usr/lib/ruby/2.3.0/net/http.rb:880:in `open'
	from /usr/lib/ruby/2.3.0/net/http.rb:880:in `block in connect'
	from /usr/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
	from /usr/lib/ruby/2.3.0/net/http.rb:878:in `connect'
	from /usr/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
	from /usr/lib/ruby/2.3.0/net/http.rb:852:in `start'
	from /usr/lib/ruby/2.3.0/net/http.rb:1384:in `request'
	from /usr/lib/ruby/gems/2.3.0/gems/httparty-0.13.1/lib/httparty/request.rb:93:in `perform'
	from /usr/lib/ruby/gems/2.3.0/gems/httparty-0.13.1/lib/httparty.rb:521:in `perform_request'
	from /usr/lib/ruby/gems/2.3.0/gems/httparty-0.13.1/lib/httparty.rb:457:in `get'
	from /var/lib/nowshowing/plex.rb:29:in `get'
	from /usr/local/sbin/emailreport:104:in `getMovies'
	from /usr/local/sbin/emailreport:377:in `main'
	from /usr/local/sbin/emailreport:397:in `<main>'

I've also set the normal report to run and obv it timed out as well. All the log files are empty because no report was run. Tried a few users on discord and they suggested an Open Ticket here. Thanks for your time.

Container Variable: EMAIL_BODY_DISPLAY_TITLE Auto-Populates When Blank

If the EMAIL_BODY_DISPLAY_TITLE is left blank, it will auto populate with Now Showing on Plex. This should be changed to reflect the desire to leave the section blank while still outputting the section in the config.yaml due to a requirement of the code.

Current:
email:
title: Now Showing on Plex

Desired:
email:
title:

Empty Library Freezes NowShowing

Please note that I am using the Dev branch as you applied the fixes for failed lookups not failing and moving on.

Looks like having an empty Library in Plex locks up NowShowing. Running with -vvv records this last and it just sits there:

D, [2018-01-16T13:49:21.844444 #855] DEBUG -- : Debug info for plexmediaserver connection D, [2018-01-16T13:49:21.844552 #855] DEBUG -- : 200 D, [2018-01-16T13:49:21.844648 #855] DEBUG -- : #<HTTParty::Request:0x000055e4619b60e0 @http_method=Net::HTTP::Get, @path=#<URI::Generic /library/sections/28/all>, @options={:limit=>5, :assume_utf16_is_big_endian=>true, :default_params=>{}, :follow_redirects=>true, :parser=>HTTParty::Parser, :connection_adapter=>HTTParty::ConnectionAdapter, :base_uri=>"http://192.168.1.4:32400", :format=>:xml, :headers=>{"X-Plen-Token"=>"KB4PPvVy2isVepnqBCyz", "X-Plex-Token"=>"KB4PPvVy2isVepnqBCyz"}}, @last_uri=#<URI::HTTP http://192.168.1.4:32400/library/sections/28/all>, @raw_request=#<Net::HTTP::Get GET>, @last_response=#<Net::HTTPOK 200 OK readbody=true>> D, [2018-01-16T13:49:21.844891 #855] DEBUG -- : #<HTTParty::Response:0x55e4619e4580 parsed_response={"MediaContainer"=>{"size"=>"0", "allowSync"=>"1", "art"=>"/:/resources/movie-fanart.jpg", "identifier"=>"com.plexapp.plugins.library", "librarySectionID"=>"28", "librarySectionTitle"=>"UHD Movies", "librarySectionUUID"=>"b1977f90-c7c6-4430-ba6d-2a141b7b7b38", "mediaTagPrefix"=>"/system/bundle/media/flags/", "mediaTagVersion"=>"1514426390", "sortAsc"=>"1", "thumb"=>"/:/resources/movie.png", "title1"=>"UHD Movies", "title2"=>"All UHD Movies", "viewGroup"=>"movie", "viewMode"=>"131122", "__content__"=>"\n"}}, @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"content-type"=>["text/xml;charset=utf-8"], "content-length"=>["484"], "connection"=>["close"], "x-plex-protocol"=>["1.0"], "cache-control"=>["no-cache"], "date"=>["Tue, 16 Jan 2018 18:49:21 GMT"]}>

After removing the empty Library from Plex, I ran it again and it completed, with the TVDB API issues that they've been having, but it completed. Looks like some logic for an empty Library may need to be applied. I understand that this is most likely an edge case as most users won't have an empty Library, but I had it created waiting for me to find the appropriate content that I wanted to include in it.

Email password escaped ?

I'm having issue when sending emails. It's telling me the authentication failed, and I can notice the same thing on my mail server logs, clearly it's trying to log in with the wrong info. I'm pretty confident in the settings I'm using since I use the exact same on the same machine from Thunderbird and it's working fine. Since I may or may not have double quotes in my password (and also the username contains an '@' char), I'm wondering if those 2 infos are properly handled / escaped ? Thanks.

Direct Link to plex item

nice app, would use it if the user could click on a plex item and be taken right to the item in plex, like {plexurl} notification tag in plexpy.

Year not being added to movies in email

Everything is running flawlessly, but I'm having a strange issue where the year isn't being added to the email. See the attached screenshot, but the gist is that instead of The Perfect Storm (2000), it shows as The Perfect Storm().

Thoughts on if I'm doing something wrong?

img_0525

Unable to configure config file.

Hi,

I have this installed on my synology running docker. After I added all the variables listed, and go to localhost:6878

I see this
Default NowShowing Page
This will be replaced after you run your first report

How do I force the first report?

Possible base image

More base type functionality is needed in the dockerfile.
ie: s6-overlay, user permissions, tzdata & shadow.
Consider making this permanent into our own FROM :base, or using lsio:base-alpine.

Can't create webreport

I'm attempting to run just the web report. This initially was working. I just noticed the other day when I check on it, that the web report stopped updating on the 30th. I am running the Docker container version and as mentioned had it all working. Now I'm getting the following trying to run the command line manual creation:

/usr/lib/ruby/2.3.0/psych.rb:379:in `parse': (/config/advanced.yaml): did not find expected key while parsing a block mapping at line 22 column 3 (Psych::SyntaxError)
	from /usr/lib/ruby/2.3.0/psych.rb:379:in `parse_stream'
	from /usr/lib/ruby/2.3.0/psych.rb:327:in `parse'
	from /usr/lib/ruby/2.3.0/psych.rb:254:in `load'
	from /usr/lib/ruby/2.3.0/psych.rb:475:in `block in load_file'
	from /usr/lib/ruby/2.3.0/psych.rb:474:in `open'
	from /usr/lib/ruby/2.3.0/psych.rb:474:in `load_file'
	from /usr/local/sbin/webreport:67:in `initialize'
	from /usr/local/sbin/webreport:370:in `new'
	from /usr/local/sbin/webreport:370:in `main'
	from /usr/local/sbin/webreport:398:in `<main>'

This is the content of the file:

---
email:
  title: 'New This Week'
  image: 'http://i.imgur.com/LNTSbFl.png'
  footer: 'Thanks for watching!'
  language: 'en'
web:
  title_image: 'img/nowshowing.png'
  logo: 'img/logo.png'
  headline_title: 'Just added:'
  headliners: 'Laughs, Screams, Thrills, Entertainment'
  footer: 'Thanks for watching!'
  language: 'en'
plex:
  plex_user_emails: 'no'
mail:
  from: 'Plex Server'
  subject: 'Now Showing'
  recipients_email: ['']
  recipients: ['']
report:
  interval: 7
  report_type: 'webonly'
  email_report_time: ''
  web_report_time: '30 23 * * *''
  extra_details: 'yes'
  test: 'disable'

Issue sending email or generating report

I'm running this on unraid, and I'm trying this command: docker exec nowshowing emailreport -d -t

But I'm getting this:

/usr/local/sbin/emailreport:128:in `block in getMovies': undefined method `each' for nil:NilClass (NoMethodError)
	from /usr/local/sbin/emailreport:106:in `each'
	from /usr/local/sbin/emailreport:106:in `getMovies'
	from /usr/local/sbin/emailreport:377:in `main'
	from /usr/local/sbin/emailreport:397:in `<main>'

I also tried docker exec nowshowing combinedreport -t and it's giving me similar error:

/usr/local/sbin/combinedreport:128:in `block in getMovies': undefined method `each' for nil:NilClass (NoMethodError)
	from /usr/local/sbin/combinedreport:106:in `each'
	from /usr/local/sbin/combinedreport:106:in `getMovies'
	from /usr/local/sbin/combinedreport:377:in `main'
	from /usr/local/sbin/combinedreport:402:in `<main>'

This is my current advanced.yaml, I basically changed only plex_user_emails to no (because I'm still testing and don't want it to auto run the cron job) and adding my own email under recipients_email

email:
  title: 'New This Week'
  image: 'http://i.imgur.com/LNTSbFl.png'
  footer: 'Thanks for watching!'
  language: 'en'
web:
  title_image: 'img/nowshowing.png'
  logo: 'img/logo.png'
  headline_title: 'Just added:'
  headliners: 'Laughs, Screams, Thrills, Entertainment'
  footer: 'Thanks for watching!'
  language: 'en'
plex:
  plex_user_emails: 'no'
mail:
  from: 'Plex Server'
  subject: 'Now Showing'
  recipients_email: ['[email protected]']
  recipients: ['PLEX_USER']
report:
  interval: 7
  report_type: 'both'
  email_report_time: '47 17 * * 6'
  web_report_time: '47 17 * * *'
  extra_details: 'no'
  test: 'disable'

Test email

Despite having changed the settings in the advanced.yml file
I continue to get the following

screenshot at sep 16 17-02-21

Using Kitematic on Windows. Can you tell me what I can do to fix it?

screenshot at sep 16 17-07-09

Not All New Unwatched Episodes Showing

I have multiple newly added (within last 7 days) unwatched episodes for the same show but NowShowing only displays the latest unwatched episode. Is this by design or a bug? It would be nice to get all of the unwatched new (within last 7 days) episodes.

EOFError when trying to run email or web report.

My application hasn't sent out an email or updated the now showing area since early December.
when I run the command "docker exec nowshowing webreport"
/usr/local/sbin/webreport: end of file reached (EOFError)

docker exec nowshowing emailreport -d -t
/usr/local/sbin/emailreport: end of file reached (EOFError)

rename of files

Possible renames of files like email_body.erb for better user understanding

Remove httpd logging to console

Remove the httpd logging to console as its unneeded and will fill it up.
May need to create a services script to start httpd with more commands than are possible using the dockerfile CMD directive.

No Docker

Any way to do this without docker?

Something failed. If you are seeing this, please turn on debugging and open an issue.

How does one enable debugging on the ninthwalker/nowshowing docker image?

I'm having issues where I see the following in my logs:

E, [2018-01-12T12:21:12.025291 #808] ERROR -- : Could not connect to thetvdb.com.  Will retry in 30 seconds
E, [2018-01-12T12:21:42.143100 #808] ERROR -- : Could not connect to thetvdb.com.  Will retry in 30 seconds
E, [2018-01-12T12:22:12.437362 #808] ERROR -- : Could not connect to thetvdb.com.  Will retry in 30 seconds
E, [2018-01-12T12:22:42.556812 #808] ERROR -- : Could not connect to thetvdb.com.  Will retry in 30 seconds
E, [2018-01-12T12:23:12.677897 #808] ERROR -- : Could not connect to thetvdb.com.  Will retry in 30 seconds
E, [2018-01-12T12:23:42.781722 #808] ERROR -- : Could not connect to thetvdb.com.  Will retry in 30 seconds
E, [2018-01-12T12:24:12.897743 #808] ERROR -- : Could not connect to thetvdb.com.  Will retry in 30 seconds
E, [2018-01-12T12:24:43.027459 #808] ERROR -- : Could not connect to thetvdb.com.  Will retry in 30 seconds
E, [2018-01-12T12:24:49.907260 #808] ERROR -- : Something failed.  If you are seeing this, please turn on debugging and open an issue.

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.