mirror of
https://github.com/tubearchivist/tubearchivist-jf-plugin.git
synced 2026-03-23 20:37:14 +00:00
[GH-ISSUE #37] [Bug]: TubeArchivist-JF-Plugin: Authorization Header Not Applied Correctly #29
Labels
No labels
bug
enhancement
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tubearchivist/archived-tubearchivist-jf-plugin#29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mattkduran on GitHub (Mar 3, 2025).
Original GitHub issue: https://github.com/tubearchivist/tubearchivist-jf-plugin/issues/37
I've read the documentation
Operating System
Linux
Your Bug Report
Describe the bug
The plugin is not properly setting the Authorization header when communicating with TubeArchivist, resulting in 403 Forbidden errors when trying to access API endpoints like /api/video/{video_id}/progress/.
Steps to Reproduce
Install the TubeArchivist-JF-Plugin in Jellyfin
Configure the plugin with:
TubeArchivist URL: http://192.168.0.8:8582/
Valid API token (which works with curl commands)
Try to sync watch status or video progress between Jellyfin and TubeArchivist
Expected Behavior
The plugin should successfully authenticate with the TubeArchivist API and sync watch status and progress.
Actual Behavior
The plugin reports "Forbidden" (403) errors in the logs when trying to access TubeArchivist API endpoints:
TubeArchivist logs confirm the 403 errors:
However, using the exact same URL and token with curl works correctly:
Steps To Reproduce
Root Cause
Looking at the plugin code, I found an initialization issue. In Plugin.cs, the authorization header is set during construction:
github.com/tubearchivist/tubearchivist-jf-plugin@ab96b227a1/Jellyfin.Plugin.TubeArchivistMetadata/Plugin.cs (L60)But Instance is null at this point because it hasn't been assigned yet (Instance = this happens earlier in the constructor). This means the authorization header is created with an empty token value.
Proposed Fix
Move the header initialization after the Instance is set, and create a method to update the header whenever the API key changes:
Then modify PluginConfiguration.cs to call this method when the API key is updated:
Workaround
Restart the entire Jellyfin server after changing the API key in the plugin settings. This forces the HttpClient to be recreated with the proper token.
Environment
Jellyfin version: 10.10.6
TubeArchivist version: v0.4.13
TubeArchivist-JF-Plugin version: 1.3.4.0
Docker? Yes
OS/Environment: Ubuntu 20.04
Relevant Jellyfin log output
Anything else?
No response
@DarkFighterLuke commented on GitHub (Mar 3, 2025):
Hi, you've done a great report of what happens and you actually fixed a very common bug. Feel free to submit a PR!