bstascavage / plexReport

Scripts to generate a weekly email of new additions to Plex
67 stars 17 forks source link

Plex Home support #29

Closed bstascavage closed 9 years ago

smdion commented 9 years ago

+1 for this.

dalcombright commented 9 years ago

+1 as well for this, would love to try this tool out.

bonyboy commented 9 years ago

Does this mean that if I have Plex Home setup that I am unable to use plexReport?

joey102 commented 9 years ago

+1

@bonyboy: yes

elRadix commented 9 years ago

+1 for support for Plex Home

is this the corresponding error?

/opt/plexReport/bin/plexReport.rb -t -v
/opt/plexReport/bin/plexReport.rb:92:in `getMovies': undefined method `[]' for nil:NilClass (NoMethodError)
    from /opt/plexReport/bin/plexReport.rb:321:in `main'
    from /opt/plexReport/bin/plexReport.rb:340:in `<main>'
bstascavage commented 9 years ago

I just enabled Plex Home on my system, and everything works fine. Plex Home specifically should not be breaking this, as far as I can tell.

I suspect the issue here isn't Plex Home, but that users are using the wrong 'token' (which is my fault, since my instructions could be clearer). For people getting the following error:

/opt/plexReport/bin/plexReport.rb -t -v /opt/plexReport/bin/plexReport.rb:92:ingetMovies': undefined method []' for nil:NilClass (NoMethodError) from /opt/plexReport/bin/plexReport.rb:321:inmain' from /opt/plexReport/bin/plexReport.rb:340:in <main>'

Can you please try the following:

  1. Verify that you have the right API token in your config file. Go to: https://plex.tv/devices.xml and send me the output, along with the output of your config file, so I can verify it.
joey102 commented 9 years ago

I've emailed you on brian@stascavage.com with the requested files. I've verified using the correct tokens, as far as I am aware.

smdion commented 9 years ago

I'm 99% sure I'm using the correct token as well. Its the one specific to the unRAID server.

bstascavage commented 9 years ago

I was able to reproduce the issue. To help me verify, I created a new branch with Plex Home code.

To test, in your plexReport directory, run

git checkout -b plexhome origin/plexhome

After that, give the script a try.

To switch back to the old code, you can run:

git checkout master

ersw1187 commented 9 years ago

When I run this command I get the following message: fatal: Cannot update paths and switch to branch 'plexhome' at the same time. Did you intend to checkout 'origin/plexhome' which can not be resolved as commit?

ersw1187 commented 9 years ago

I then ran: git checkout -b plexhome

This resulted in the following M .gitignore M Gemfile M Gemfile.lock M README.md M etc/config.yaml.example M etc/email_body.erb M images/plex.png Switched to a new branch 'plexhome'

I subsequently ran: bin/plexReport.rb -v

I still get the same result: /opt/plexReport/bin/plexReport.rb:92:in getMovies': undefined method[]' for nil:NilClass (NoMethodError) from /opt/plexReport/bin/plexReport.rb:321:in main' from /opt/plexReport/bin/plexReport.rb:340:in

'

bstascavage commented 9 years ago

Clone the repo to a different folder, and then try my steps (make sure you copy your config over)

ersw1187 commented 9 years ago

Managed to run it with option -v. Created a log of about 112MB.

At the end the terminal screen shows the following error

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/smtp.rb:541:in initialize': execution expired (Net::OpenTimeout) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/smtp.rb:541:inopen' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/smtp.rb:541:in tcp_socket' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/smtp.rb:551:inblock in do_start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/smtp.rb:550:in do_start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/smtp.rb:520:instart' from /Library/Ruby/Gems/2.0.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:in deliver!' from /Library/Ruby/Gems/2.0.0/gems/mail-2.6.3/lib/mail/message.rb:252:indeliver!' from /Users/ersw1187/plexReport/bin/mailReport.rb:89:in block in sendMail' from /Users/ersw1187/plexReport/bin/mailReport.rb:80:ineach' from /Users/ersw1187/plexReport/bin/mailReport.rb:80:in sendMail' from bin/plexReport.rb:338:inmain' from bin/plexReport.rb:342:in `

'

ersw1187 commented 9 years ago

After rereading the Plex Forum I switched from using my hosted mail provider to Gmail (ensuring that I had set the security settings to the 'lesssecureapps' setting) and I set the SMTP port to 587 (TLS) and not to 465 (SSL)

Low and behold, the report appeared. Maybe a good addition to the installation guide to mention that people should use for example Gmail instead of a hosted mail provider

bstascavage commented 9 years ago

Good call, thanks!

dalcombright commented 9 years ago

still getting same error on unRAID with latest changes.

/opt/plexReport/bin/plexReport.rb:92:in getMovies': undefined method[]' for nil:NilClass (NoMethodError) from /opt/plexReport/bin/plexReport.rb:321:in main' from /opt/plexReport/bin/plexReport.rb:340:in

'

On Mon, Feb 2, 2015 at 10:20 AM, Brian notifications@github.com wrote:

Closed #29 https://github.com/bstascavage/plexReport/issues/29 via #38 https://github.com/bstascavage/plexReport/pull/38.

— Reply to this email directly or view it on GitHub https://github.com/bstascavage/plexReport/issues/29#event-228565244.

bstascavage commented 9 years ago

What is your plexWatch.log look like?

dalcombright commented 9 years ago

Logfile created on 2015-02-02 11:01:13 -0500 by logger.rb/31641

I, [2015-02-02T11:01:13.594004 #20] INFO -- : Starting up PlexReport I, [2015-02-02T11:01:19.532068 #31] INFO -- : Starting up PlexReport I, [2015-02-02T11:02:06.282538 #44] INFO -- : Starting up PlexReport I, [2015-02-02T11:02:49.250978 #56] INFO -- : Starting up PlexReport I, [2015-02-02T12:40:47.281106 #74] INFO -- : Starting up PlexReport I, [2015-02-02T12:42:15.302176 #86] INFO -- : Starting up PlexReport

looks clean

On Mon, Feb 2, 2015 at 1:10 PM, Brian notifications@github.com wrote:

What is your plexWatch.log look like?

— Reply to this email directly or view it on GitHub https://github.com/bstascavage/plexReport/issues/29#issuecomment-72506833 .

bstascavage commented 9 years ago

I don't think you actually updated the code then. The newest code would log an error if it cannot connect to the Plex server. You can see that on line 32 of bin/plex.rb