tubearchivist / tubearchivist-plex

Tube Archivist Plex Integration
GNU General Public License v3.0
89 stars 6 forks source link

[Bug]: global name 'urllib' is not defined #67

Open lesleyxyz opened 1 month ago

lesleyxyz commented 1 month ago

I've read the documentation.

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: 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

lamusmaser commented 1 month ago

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

folofjc commented 1 month ago

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.

Ogglord commented 1 month ago

I have the same issue in my docker.