Hellowlol / bw_plex

binge watching for plex
MIT License
366 stars 23 forks source link

Jumping but nothing happens. #14

Closed gylli251 closed 6 years ago

gylli251 commented 6 years ago

https://i.imgur.com/Iix09xw.png

2018-02-07 23:26:19,922 :: bw_plex :: DEBUG :: Should have called jump 2018-02-07 23:26:19,922 :: bw_plex :: DEBUG :: Called jump with 95.7126530612 86 2018-02-07 23:26:19,965 :: bw_plex :: DEBUG :: client xx 31

Tried different players but nothing happens.

Hellowlol commented 6 years ago

What players have you used?

gylli251 commented 6 years ago

Nvidia Shield Plex Nvidia Shield Kodi (Plex addon) Plex Media Player (Windows) Browser (Google Chrome)

Found this in your code so i'm guessing web does not work. # This does not work on plex web since the fucker returns the local url..

Hellowlol commented 6 years ago

I guess that was some issues when I was running it on my main server. I think I have gotten it to work on plexweb. Btw you have checked the option in the players where you allow them to be controlled?

Hellowlol commented 6 years ago

I use openpht and the iOS client to test this.

gylli251 commented 6 years ago

Not really sure what you referring to. What option?

Side note. Any chance I can talk to you via pm on discord or something?

gylli251 commented 6 years ago

Turned on logging in the plex media player. Nothing there shows a seek forward attempt. Also nothing in plex Web.

gylli251 commented 6 years ago

Found something in the plex api saying that the server and the player need to be on the same network. Is this right?

-EDIT-

Confirmed via SSH tunnel. The player and the server need to be on the same LAN.

Any way to bypass this issue?

Hellowlol commented 6 years ago

I don't think so. You can try to enable proxyThroughServer

Try writing client.proxyThroughServer() before the seek command. I that doesn't help I dunno. Are you running plex on a vps or using plexcloud?

Let me know how it goes.

gylli251 commented 6 years ago
2018-02-09 21:03:49,997 :: bw_plex :: DEBUG :: client xx 19
2018-02-09 21:03:50,135 :: bw_plex :: DEBUG :: Jumped gylli251 Plex Web (Chrome) to 39.9847619048 Bleach.s01e01
2018-02-09 21:03:54,560 :: bw_plex :: DEBUG :: Done converting /tmp/offset_jcW8OM.wav
2018-02-09 21:03:55,836 :: bw_plex :: DEBUG :: Found Bleach.s01e01 start 00:13, end 00:39, prog 00:27
2018-02-09 21:03:55,843 :: bw_plex :: DEBUG :: Bleach.s01e01 is in the correct time range
2018-02-09 21:03:55,847 :: bw_plex :: DEBUG :: Should have called jump
2018-02-09 21:03:55,854 :: bw_plex :: DEBUG :: Called jump with 39.9847619048 28
2018-02-09 21:03:56,049 :: bw_plex :: DEBUG :: Found Bleach.s01e01 start 00:13, end 00:39, prog 00:25
2018-02-09 21:03:56,050 :: bw_plex :: DEBUG :: Bleach.s01e01 is in the correct time range
2018-02-09 21:03:56,050 :: bw_plex :: DEBUG :: Should have called jump
2018-02-09 21:03:56,073 :: bw_plex :: DEBUG :: Called jump with 39.9847619048 31
2018-02-09 21:03:56,107 :: bw_plex :: DEBUG :: client xx 25
2018-02-09 21:03:56,495 :: bw_plex :: DEBUG :: Jumped gylli251 Plex Web (Chrome) to 39.9847619048 Bleach.s01e01
2018-02-09 21:03:58,302 :: bw_plex :: DEBUG :: Found Bleach.s01e01 start 00:13, end 00:39, prog 00:25
2018-02-09 21:03:58,307 :: bw_plex :: DEBUG :: Bleach.s01e01 is in the correct time range
2018-02-09 21:03:58,309 :: bw_plex :: DEBUG :: Should have called jump
2018-02-09 21:03:58,312 :: bw_plex :: DEBUG :: Called jump with 39.9847619048 31
2018-02-09 21:03:58,326 :: bw_plex :: DEBUG :: client xx 25
2018-02-09 21:03:58,429 :: bw_plex :: DEBUG :: Jumped gylli251 Plex Web (Chrome) to 39.9847619048 Bleach.s01e01
2018-02-09 21:04:00,000 :: bw_plex :: DEBUG :: Found Bleach.s01e01 start 00:13, end 00:39, prog 00:27
2018-02-09 21:04:00,003 :: bw_plex :: DEBUG :: Bleach.s01e01 is in the correct time range
2018-02-09 21:04:00,008 :: bw_plex :: DEBUG :: Should have called jump
2018-02-09 21:04:00,013 :: bw_plex :: DEBUG :: Called jump with 39.9847619048 31
2018-02-09 21:04:00,062 :: bw_plex :: DEBUG :: client xx 27
2018-02-09 21:04:00,262 :: bw_plex :: DEBUG :: Jumped gylli251 Plex Web (Chrome) to 39.9847619048 Bleach.s01e01

Sadly it wont work.

Im using a server that's not on my network. I also plan to use this for other users that my libary is shared with. (renting a server from hetzner) image Just to make sure i uploaded where i put the command in the picture above. I tried adding it to other spots as well but didn't help.

Any way of seeing what's happening when it tries to connect? via plexapi logs?


Little bit of a side note.

https://github.com/samcm/synclounge

They use some way of syncing players together without them being on the same network.

Any way to implement what they do into this?

Hellowlol commented 6 years ago

you need to move proxyThroughServer to after the client is initiated (one line down)

gylli251 commented 6 years ago

As I mentioned I tried that aswell. :(

gylli251 commented 6 years ago

Tried it one more time just to make sure. image

Same thing. Nothing happens.

2018-02-10 19:55:42,034 :: bw_plex :: INFO :: Loading existing files in db
Read fprints for 11 files ( 118679 hashes) from /home/seed/.config/bw_plex/hashes.pklz (0.00% dropped)
2018-02-10 19:55:44,098 :: bw_plex :: DEBUG :: Loading themes
2018-02-10 19:55:44,098 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/Bleach__36019__.wav
2018-02-10 19:55:44,098 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/Black Mirror__526__.wav
2018-02-10 19:55:44,098 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/Akame ga Kill__33579__.mp4
2018-02-10 19:55:44,098 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/Friends__16644__.wav
2018-02-10 19:55:44,098 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/Arrow__263__.wav
2018-02-10 19:55:44,099 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/Hells Kitchen (US)__26587__.wav
2018-02-10 19:55:44,099 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/American Gods__63__.wav
2018-02-10 19:55:44,099 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/Lucifer__24370__.wav
2018-02-10 19:55:44,099 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/The Simpsons__7363__.wav
2018-02-10 19:55:44,099 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/Family Guy__1374__.wav
2018-02-10 19:55:44,099 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/The Office (US)__32796__.wav
2018-02-10 19:55:44,099 :: bw_plex :: DEBUG :: /home/seed/.config/bw_plex/themes/Game of Thrones__2095__.wav
Watching for media on LokiGDrive
2018-02-10 19:55:46,746 :: bw_plex :: DEBUG :: Found Lucifer.s02e11 start 06:33, end 07:00, prog 31:08
2018-02-10 19:55:46,746 :: bw_plex :: DEBUG :: Skipping Lucifer.s02e11 as it not in the correct time range jumping in -1474.72362812
2018-02-10 19:55:52,162 :: bw_plex :: DEBUG :: Failed to find 36890 in the db
2018-02-10 19:55:52,174 :: bw_plex :: DEBUG :: theme media type episode
2018-02-10 19:55:52,174 :: bw_plex :: DEBUG :: task theme /home/seed/.config/bw_plex/themes/Arrow__263__.wav
2018-02-10 19:55:52,174 :: bw_plex :: DEBUG :: Download the first 10 minutes of Arrow.s06e12 as .wav
2018-02-10 19:55:52,174 :: bw_plex :: DEBUG :: Checking if we can reach Arrow.s06e12 directly
2018-02-10 19:55:52,174 :: bw_plex :: WARNING :: Downloading from pms..
2018-02-10 19:55:52,176 :: bw_plex :: DEBUG :: calling ffmpeg with ffmpeg -loglevel panic -i https://plex.lokigdrive.tk/library/parts/75665/1517491140/file.mkv?download=1&X-Plex-Token= -ac 1 -ar 11025 -ss 0 -t 600 -acodec pcm_s16le /tmp/offset_FsG83D.wav
2018-02-10 19:55:56,317 :: bw_plex :: DEBUG :: Done converting /tmp/offset_FsG83D.wav
2018-02-10 19:55:56,881 :: bw_plex :: DEBUG :: Found Lucifer.s02e11 start 06:33, end 07:00, prog 31:18
2018-02-10 19:55:56,881 :: bw_plex :: DEBUG :: Skipping Lucifer.s02e11 as it not in the correct time range jumping in -1484.72362812
2018-02-10 19:56:01,093 :: bw_plex :: DEBUG :: Found Bleach.s01e01 start 00:13, end 00:39, prog 00:43
2018-02-10 19:56:01,098 :: bw_plex :: DEBUG :: Skipping Bleach.s01e01 as it not in the correct time range jumping in -29.4395464853
2018-02-10 19:56:01,386 :: bw_plex :: DEBUG :: Found Bleach.s01e01 start 00:13, end 00:39, prog 00:00
Sat Feb 10 19:56:06 2018 Analyzed #1 /tmp/offset_FsG83D.wav of 599.864 s to 25376 hashes
2018-02-10 19:56:06,771 :: bw_plex :: DEBUG :: Found Lucifer.s02e11 start 06:33, end 07:00, prog 31:28
2018-02-10 19:56:06,775 :: bw_plex :: DEBUG :: Skipping Lucifer.s02e11 as it not in the correct time range jumping in -1494.72362812
2018-02-10 19:56:07,126 :: bw_plex :: DEBUG :: no result just returning -1
2018-02-10 19:56:07,127 :: bw_plex :: DEBUG :: Deleted /tmp/offset_FsG83D.wav
2018-02-10 19:56:07,127 :: bw_plex :: DEBUG :: Check if we can find the next media item.
2018-02-10 19:56:10,466 :: bw_plex :: DEBUG :: Found Bleach.s01e01 start 00:13, end 00:39, prog 00:09
2018-02-10 19:56:16,737 :: bw_plex :: DEBUG :: Found Lucifer.s02e11 start 06:33, end 07:00, prog 31:38
2018-02-10 19:56:16,738 :: bw_plex :: DEBUG :: Skipping Lucifer.s02e11 as it not in the correct time range jumping in -1504.72362812
2018-02-10 19:56:20,461 :: bw_plex :: DEBUG :: Found Bleach.s01e01 start 00:13, end 00:39, prog 00:19
2018-02-10 19:56:20,462 :: bw_plex :: DEBUG :: Bleach.s01e01 is in the correct time range
2018-02-10 19:56:20,462 :: bw_plex :: DEBUG :: Should have called jump
2018-02-10 19:56:20,463 :: bw_plex :: DEBUG :: Called jump with 39.9847619048 93
2018-02-10 19:56:20,472 :: bw_plex :: DEBUG :: client xx 19
2018-02-10 19:56:23,660 :: bw_plex :: DEBUG :: Found Bleach.s01e01 start 00:13, end 00:39, prog 00:22
2018-02-10 19:56:23,660 :: bw_plex :: DEBUG :: Bleach.s01e01 is in the correct time range
2018-02-10 19:56:26,741 :: bw_plex :: DEBUG :: Found Lucifer.s02e11 start 06:33, end 07:00, prog 31:48
2018-02-10 19:56:26,742 :: bw_plex :: DEBUG :: Skipping Lucifer.s02e11 as it not in the correct time range jumping in -1514.72362812
2018-02-10 19:56:31,416 :: bw_plex :: DEBUG :: Found Bleach.s01e01 start 00:13, end 00:39, prog 00:22
2018-02-10 19:56:31,416 :: bw_plex :: DEBUG :: Bleach.s01e01 is in the correct time range
Hellowlol commented 6 years ago

:( dunno how synclounge does this. Are you running the program on the server or on a pc on the local network? Btw, remove your token.

gylli251 commented 6 years ago

I am running the program on the server.

Hellowlol commented 6 years ago

I dont think thats possible. I dont know how synclounge handles this but i couldnt get any usefull info via plex. I can get the public ip and port but that didnt work. (i assumed it stopped in the firewall) @samcm Any insight you give me on how your handling connections to clients that isnt on the same lan?

samcm commented 6 years ago

Heya,

SyncLounge doesn't actually send commands to clients on different networks. Each browser (running SL) connects to its client locally, and pseudo-commands are sent between SL instances that instruct SL to action commands.

In saying that, you should be able to get this sort of solution running with a remote server. If you're using the server to proxy-connect to clients 100% of the time then yeah thats probably the issue. In reality you only need to do that for clients that can't run a HTTP server (like web). I haven't thoroughly gone through the code here, just going off the details in this issue, so please excuse me if you're already doing any of the following:

Fetch your devices from https://plex.tv/api/resources?includeHttps=1. This is an account-wide endpoint which will return servers and clients assigned to the account. From there, you can directly connect to each client or server. Remote servers should also return a URL that is reachable. Then you can marry the two and work your magic 👍

You can see how SL does the above process here: https://github.com/samcm/synclounge/tree/master/src/assets/js/plex It's messy code that I've since refactored but should do the job. Let me know if you need more info.

Hellowlol commented 6 years ago

Thanks! Now it all makes sense. I looked at the resources but I couldn't find a public method that was accessible thru a firewall. 👍🏼

Hellowlol commented 6 years ago

Closing this as it does not work on remote clients.