kannibalox / PtpUploader

PtpUploader is a bot that automatically uploads releases to PTP.
68 stars 21 forks source link

Not able to access after starting. #17

Closed leonard4546 closed 2 years ago

leonard4546 commented 2 years ago

I'm trying to run this on my seedbox. I started it using given command but not able to acces at http://seedbox_ip:8000 . Port 8000 is open.

is there any method to check for logs. and is it possible to change port like old version

kannibalox commented 2 years ago

By default it only listens on localhost (127.0.0.1), but you can change both the bind address and the port by adding them after runuploader, e.g. PtpUploader runuploader 0.0.0.0:12345

Only individual job logs are saved to disk, so the easiest way to save the main output would be to just append it to a file, e.g. PtpUploader runuploader 2>&1 >> /home/example/ptpuploader.log If you want to get fancier, you can even override the default Django logging config in ~/.config/ptpuploader/config.yml:

# At the end of the file
LOGGING: {
    "version": 1,
    "disable_existing_loggers": True,
    "formatters": {
        "root_formatter": {
            "format": "%(asctime)-15s %(levelname)-5s %(name)-11s %(message)s"
        }
    },
    "handlers": {
        "console": {
            "level": "INFO",
            "class": "logging.StreamHandler",
            "formatter": "root_formatter",
        },
        "file": {
            "level": "INFO",
            "class": "logging.FileHandler",
            "filename": "/home/example/ptpuploader.log",
            "formatter": "root_formatter",
        },
    },
    "loggers": {
        "": {
            "handlers": [
                "console",
            ],
            "level": "INFO",
            "propagate": True,
        }
    },
}
leonard4546 commented 2 years ago

Thanks. I'm able to access now. but I'm facing two new issues.

1) with rtorrent: I entered only ip address without any port then it wasn't able to find scgi port. I access rutorrent at http://seedbiox_ip/rutorrent. so I tried with that too and still error.

2) and with file browser: https://files.catbox.moe/ssseqw.png

Thanks

kannibalox commented 2 years ago

Aha, I can see how that comment in the example config would be confusing. If you leave the address blank, PtpUploader will look in ~/.rtorrent.rc to try to figure out where to connect to, otherwise you'll need to provide the full IP/port combo. However, since you're running on a seedbox, rtorrent is most likelly running via a socket file.

TL;DR grep scgi ~/.rtorrent.rc will most likely give you what needs to be filled in

For 2, looks like the selection of a default root folder is messed up, in the meantime try setting file_selector_root in the config. Also, in a pinch you can copy & paste paths directly in there and skip that dialog entirely. Edit: should be fixed in the latest version.

leonard4546 commented 2 years ago

Thanks I left it blank and now it's working. Still facing problem with file browser with new commit. I'm able to upload by providing path so it is sufficient. Thanks for working on this tool.

btw is it possible to overwrite existing torrent if upload fails for some reasons. it throws error if torrent with same name already exist so have to ssh into server to delete that 😅

Edit: And I'm getting this error for full BD. Upload path '/home/xyz/bd_folder/' doesn't contain any video files.

kannibalox commented 2 years ago

Thanks I left it blank and now it's working. Still facing problem with file browser with new commit. I'm able to upload by providing path so it is sufficient. Thanks for working on this tool.

I've added error logging for django requests to try and help troubleshoot.

btw is it possible to overwrite existing torrent if upload fails for some reasons. it throws error if torrent with same name already exist so have to ssh into server to delete that sweat_smile

Yeah that's definitely been a pain, I don't have a good example to do a full test with but it should now avoid having to re-create the torrent as long as nothing's changed.

Edit: And I'm getting this error for full BD. Upload path '/home/xyz/bd_folder/' doesn't contain any video files.

Unfortunately full blu-rays aren't supported at the moment, mostly because there doesn't seem to be a great way to get BDInfo installed on linux. I can take another stab at it, but if your seedbox doesn't support running things in either docker or mono, you'll probably still be out of luck :disappointed:

newadventure079 commented 2 years ago

@kannibalox I believe https://github.com/L4GSP1KE/Upload-Assistant uses bdinfo. You could look and see what he's doing for it

leonard4546 commented 2 years ago

I've added error logging for django requests to try and help troubleshoot.

How to access this log?

Unfortunately full blu-rays aren't supported at the moment, mostly because there doesn't seem to be a great way to get BDInfo installed on linux. I can take another stab at it, but if your seedbox doesn't support running things in either docker or mono, you'll probably still be out of luck 😞

I use https://github.com/Aniverse/bluray/blob/master/bluray for bdinfo. and it works as expected

kannibalox commented 2 years ago

I've added error logging for django requests to try and help troubleshoot.

How to access this log?

It will be part of the main output, here's an example of me breaking the file browser on purpose:

2022-01-26 12:56:44,357 ERROR django.request Internal Server Error: /ajax/localdir
Traceback (most recent call last):
  File "/home/rtorrent/.cache/pypoetry/virtualenvs/ptpuploader-iTQyqGHT-py3.8/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/home/rtorrent/.cache/pypoetry/virtualenvs/ptpuploader-iTQyqGHT-py3.8/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/rtorrent/.cache/pypoetry/virtualenvs/ptpuploader-iTQyqGHT-py3.8/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/home/rtorrent/src/PtpUploader/src/PtpUploader/web/views.py", line 262, in local_dir
    for child in sorted(d.iterdir()):
  File "/usr/lib/python3.8/pathlib.py", line 1122, in iterdir
    for name in self._accessor.listdir(self):
FileNotFoundError: [Errno 2] No such file or directory: '/sdfgasdf'
2022-01-26 12:56:44,359 ERROR django.server "GET /ajax/localdir?_=1643201802520 HTTP/1.0" 500 81395