[GH-ISSUE #67] [Bug]: global name 'urllib' is not defined #24

Closed
opened 2026-03-23 20:33:30 +00:00 by mirror · 6 comments
Owner

Originally created by @lesleyxyz on GitHub (May 23, 2024).
Original GitHub issue: https://github.com/tubearchivist/tubearchivist-plex/issues/67

I've read the documentation.

  • I'm running the latest version of the TubeArchivist Plex Integration Scanner and Agent. I have read the latest release notes and installation instructions.

Operating System

Debian + Docker (linuxserver/plex)

Your Bug Report

Describe the bug

Installing the plugin in a docker container throws a missing library error.

Steps To Reproduce

  1. Follow the steps to install the agent/scanner
  2. Configure a library to use the agent/scanner
  3. The library will be empty

Expected behavior

When scanning the library, no video will be returned.
Instead an urllib error will be thrown.

Relevant log output

root@docker:/config/Library/Application Support/Plex Media Server/Logs/TubeArchivist Scanner# cat _root_.scanner.log
2024-05-23 21:36:40,359 [TubeArchivist Scanner] INFO - TubeArchivist scanner started: 2024-05-23 21:36:40,359141
2024-05-23 21:36:40,538 [TubeArchivist Scanner] DEBUG - TA URL: https://ta.lan
2024-05-23 21:36:40,538 [TubeArchivist Scanner] INFO - Attempting to connect to TubeArchivist at https://ta.lan with provided token from `ta_config.json` file.
2024-05-23 21:36:40,808 [TubeArchivist Scanner] ERROR - Error connecting to TubeArchivist with URL 'https://ta.lan', Exception: 'global name 'urllib' is not defined'

Anything else?

It appears to come from this line:
github.com/tubearchivist/tubearchivist-plex@a8774f19c3/Contents/Code/init.py#L200

because urllib is assumed while urllib2 may also have been used.
Instead, I believe removing this line will work as expected whether urllib or urllib2 has been imported

Note: It is also present in the Scanner, so modification there will probably also be required:
github.com/tubearchivist/tubearchivist-plex@a8774f19c3/Scanners/Series/TubeArchivist Series Scanner.py (L118)

Originally created by @lesleyxyz on GitHub (May 23, 2024). Original GitHub issue: https://github.com/tubearchivist/tubearchivist-plex/issues/67 ### I've read the documentation. - [X] I'm running the latest version of the TubeArchivist Plex Integration Scanner and Agent. I have read the latest release notes and installation instructions. ### Operating System Debian + Docker (linuxserver/plex) ### Your Bug Report ## Describe the bug Installing the plugin in a docker container throws a missing library error. ## Steps To Reproduce 1. Follow the steps to install the agent/scanner 2. Configure a library to use the agent/scanner 3. The library will be empty ## Expected behavior When scanning the library, no video will be returned. Instead an urllib error will be thrown. ### Relevant log output ```Shell root@docker:/config/Library/Application Support/Plex Media Server/Logs/TubeArchivist Scanner# cat _root_.scanner.log 2024-05-23 21:36:40,359 [TubeArchivist Scanner] INFO - TubeArchivist scanner started: 2024-05-23 21:36:40,359141 2024-05-23 21:36:40,538 [TubeArchivist Scanner] DEBUG - TA URL: https://ta.lan 2024-05-23 21:36:40,538 [TubeArchivist Scanner] INFO - Attempting to connect to TubeArchivist at https://ta.lan with provided token from `ta_config.json` file. 2024-05-23 21:36:40,808 [TubeArchivist Scanner] ERROR - Error connecting to TubeArchivist with URL 'https://ta.lan', Exception: 'global name 'urllib' is not defined' ``` ### Anything else? It appears to come from this line: https://github.com/tubearchivist/tubearchivist-plex/blob/a8774f19c3d7801f2b1089f61e9c8ed4d9919558/Contents/Code/__init__.py#L200 because urllib is assumed while urllib2 may also have been used. Instead, I believe removing this line will work as expected whether urllib or urllib2 has been imported Note: It is also present in the Scanner, so modification there will probably also be required: https://github.com/tubearchivist/tubearchivist-plex/blob/a8774f19c3d7801f2b1089f61e9c8ed4d9919558/Scanners/Series/TubeArchivist%20Series%20Scanner.py#L118
Author
Owner

@lamusmaser commented on GitHub (May 23, 2024):

Acknowledged. This looks related to some handling that was recently added. I'll see if I can fix that in a better method.

<!-- gh-comment-id:2128071368 --> @lamusmaser commented on GitHub (May 23, 2024): Acknowledged. This looks related to some handling that was recently added. I'll see if I can fix that in a better method.
Author
Owner

@folofjc commented on GitHub (May 27, 2024):

I am getting this error in the Scanner log. I just installed it, so I guess I got the recent handling change.

EDIT: If I commented out this line:
github.com/tubearchivist/tubearchivist-plex@a8774f19c3/Scanners/Series/TubeArchivist Series Scanner.py (L118)

(and add the port number in the ta_config.json file)

then the scanner appears to continue.

<!-- gh-comment-id:2133052934 --> @folofjc commented on GitHub (May 27, 2024): I am getting this error in the Scanner log. I just installed it, so I guess I got the recent handling change. EDIT: If I commented out this line: https://github.com/tubearchivist/tubearchivist-plex/blob/a8774f19c3d7801f2b1089f61e9c8ed4d9919558/Scanners/Series/TubeArchivist%20Series%20Scanner.py#L118 (and add the port number in the ta_config.json file) then the scanner appears to continue.
Author
Owner

@Ogglord commented on GitHub (Jun 2, 2024):

I have the same issue in my docker.

<!-- gh-comment-id:2143992473 --> @Ogglord commented on GitHub (Jun 2, 2024): I have the same issue in my docker.
Author
Owner

@dalton-morrison commented on GitHub (Sep 13, 2024):

I am having the same issue. Installed via docker compose on top of UnRAID.

<!-- gh-comment-id:2349497399 --> @dalton-morrison commented on GitHub (Sep 13, 2024): I am having the same issue. Installed via docker compose on top of UnRAID.
Author
Owner

@lamusmaser commented on GitHub (Sep 13, 2024):

Apologies that this has taken a long time to look into. I still haven't had development time to fix the underlying issue. I do know what the problem is, and it will be accounted for when I am able to make the next release.

<!-- gh-comment-id:2349530505 --> @lamusmaser commented on GitHub (Sep 13, 2024): Apologies that this has taken a long time to look into. I still haven't had development time to fix the underlying issue. I do know what the problem is, and it will be accounted for when I am able to make the next release.
Author
Owner

@lamusmaser commented on GitHub (Sep 13, 2024):

This should be fixed in v0.1.6. I have done testing in various ways to show that it now properly handles the URLs and should account for both python2 and python3 iterations.

I'm going to close this for now, but please let me know if there are additional instances of this error that come after updating to the latest released version.

<!-- gh-comment-id:2350020553 --> @lamusmaser commented on GitHub (Sep 13, 2024): This should be fixed in v0.1.6. I have done testing in various ways to show that it now properly handles the URLs and should account for both python2 and python3 iterations. I'm going to close this for now, but please let me know if there are additional instances of this error that come after updating to the latest released version.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tubearchivist/archived-tubearchivist-plex#24
No description provided.