debridmediamanager / zurg-testing

A self-hosted Real-Debrid webdav server you can use with Infuse. Together with rclone it can mount your Real-Debrid torrent library into your filesystem and load it to Plex or Jellyfin.
432 stars 30 forks source link

Unable to trigger refresh to plex #19

Closed dinjojo closed 8 months ago

dinjojo commented 8 months ago

The files are instantly available in zurg but it seems plex refresh is not triggered

I'm using the docker setup

Can you help on this as plex is not getting refreshed this is my config.I believe the plex script is not getting executed.

config.yml

on_library_update: sh plex_update.sh "$@"

zurg logs

2023-12-21T16:54:38.135Z    INFO    manager Compiled into 9 torrents, 0 were missing info
2023-12-21T16:54:38.146Z    INFO    manager Fetched 57 downloads
2023-12-21T16:54:38.314Z    INFO    manager Finished initializing torrent manager
2023-12-21T16:54:38.314Z    INFO    zurg    Starting server on [::]:9999
2023-12-21T16:54:38.314Z    INFO    manager Starting periodic refresh
2023-12-21T16:55:08.954Z    INFO    manager Detected changes! Refreshing 9 torrents
2023-12-21T16:55:09.314Z    INFO    manager Compiled into 9 torrents, 0 were missing info
2023-12-21T16:55:09.315Z    INFO    manager Removing torrent Silen from zurg database
2023-12-21T16:55:09.315Z    INFO    manager Finished refreshing torrents
2023-12-21T16:55:24.763Z    INFO    manager Detected changes! Refreshing 9 torrents
2023-12-21T16:55:25.099Z    INFO    manager Compiled into 9 torrents, 0 were missing info
2023-12-21T16:55:25.100Z    INFO    manager Finished refreshng torrents```

EDIT - So i modified the script to add logging and this is what i see 

```Detected update on: movies/Zombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG[TGx]
Absolute path: /mnt/zurg/movies/Zombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG[TGx]
%2Fmnt%2Fzurg%2Fmovies%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D
Encoded argument: %2Fmnt%2Fzurg%2Fmovies%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D
Section ID: 1
Final URL: http://192.168.1.111:32400/library/sections/1/refresh?path=%2Fmnt%2Fzurg%2Fmovies%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D&X-Plex-Token=XXXXX
Encoded argument: %2Fmnt%2Fzurg%2Fmovies%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D
Section ID: 2
Final URL: http://192.168.1.111:32400/library/sections/2/refresh?path=%2Fmnt%2Fzurg%2Fmovies%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D&X-Plex-Token=XXXXX
Detected update on: __all__/Zombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG[TGx]
Absolute path: /mnt/zurg/__all__/Zombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG[TGx]
%2Fmnt%2Fzurg%2F__all__%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D
Encoded argument: %2Fmnt%2Fzurg%2F__all__%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D
Section ID: 1
Final URL: http://192.168.1.111:32400/library/sections/1/refresh?path=%2Fmnt%2Fzurg%2F__all__%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D&X-Plex-Token=XXXXX
Encoded argument: %2Fmnt%2Fzurg%2F__all__%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D
Section ID: 2
Final URL: http://192.168.1.111:32400/library/sections/2/refresh?path=%2Fmnt%2Fzurg%2F__all__%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D&X-Plex-Token=XXXXX
All updated sections refreshed

Running it manually authenticates against plex

curl -v "http://192.168.1.111:32400/library/sections/1/refresh?path=%2Fmnt%2Fzurg%2Fmovies%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D&X-Plex-Token=XXXXX"
*   Trying 192.168.1.111:32400...
* Connected to 192.168.1.111 (192.168.1.111) port 32400 (#0)
> GET /library/sections/1/refresh?path=%2Fmnt%2Fzurg%2Fmovies%2FZombie.Town.2023.720p.WEBRip.800MB.x264-GalaxyRG%5BTGx%5D&X-Plex-Token=XXX HTTP/1.1
> Host: 192.168.1.111:32400
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< X-Plex-Protocol: 1.0
< Content-Length: 0
< Content-Type: text/html
< Connection: Keep-Alive
< Keep-Alive: timeout=20
< Cache-Control: no-cache
< Date: Fri, 22 Dec 2023 04:06:21 GMT
<
* Connection #0 to host 192.168.1.111 left intact
Varming73 commented 8 months ago

According to the Wiki this is how Plex updates are triggered: https://github.com/debridmediamanager/zurg-testing/wiki/Config#library-update-trigger

So I'm not sure the way you're doing it is still the right way..?

dinjojo commented 8 months ago

Its the same script wrapped under yml vs a shell script which does that.

Eventually the curl command is what makes things to work

Varming73 commented 8 months ago

I use the trigger from the config.yml directly and that triggers an update. Would be nice if it didn't trigger a full update of all Plex libraries but only the exact directory needed instead.

tgt26 commented 8 months ago

I use the trigger from the config.yml directly and that triggers an update. Would be nice if it didn't trigger a full update of all Plex libraries but only the exact directory needed instead.

How were you able to trigger it? I run the file manually and it doesn't trigger anything. What command did you run?

Edit: Never mind. It started working out of nowhere. Not sure what fixed it but I renewed my certificate in npm today because they were expired.

dinjojo commented 8 months ago

Seems like plex update script doesn't refresh plex but the inbuilt code in config works

yowmamasita commented 8 months ago

FYI if you are running the update script inside the container, and Plex is running in the host or another container, you have to use the host IP and Plex port in the update script. This is tested to be working and confirmed by many users.