datashaman / putio-automator

A suite of commands for managing torrents, transfers and files on put.io. Works well with SickRage, Sonarr, etc.
MIT License
71 stars 17 forks source link

Magnet files are not processed #47

Closed jolcese closed 2 years ago

jolcese commented 2 years ago

I'm getting this error when trying to upload a .magnet file:

Traceback (most recent call last):
  File "/home/putio/.local/bin/putio", line 8, in <module>
    sys.exit(main())
  File "/home/putio/.local/lib/python3.8/site-packages/putio_automator/cli.py", line 62, in main
    cli(auto_envvar_prefix='PUTIO', obj={})
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/putio/.local/lib/python3.8/site-packages/putio_automator/commands/torrents.py", line 73, in add
    with_db(func)
  File "/home/putio/.local/lib/python3.8/site-packages/putio_automator/db.py", line 18, in with_db
    func(connection)
  File "/home/putio/.local/lib/python3.8/site-packages/putio_automator/commands/torrents.py", line 54, in func
    transfer = ctx.obj['CLIENT'].Transfer.add_torrent(path, parent_id=parent_id)
  File "/home/putio/.local/lib/python3.8/site-packages/putiopy.py", line 582, in add_torrent
    d = cls.client.request(UPLOAD_URL, method='POST', params=params, data=data, files=files)
  File "/home/putio/.local/lib/python3.8/site-packages/putiopy.py", line 222, in request
    return _process_response(response)
  File "/home/putio/.local/lib/python3.8/site-packages/putiopy.py", line 250, in _process_response
    raise exception_class(response, error_type, error_message)
putiopy.ClientError: POST, https://upload.put.io/v2/files/upload?torrent=true, 400, NotTorrent, 'File is not a torrent file.'
jolcese commented 2 years ago

My bad. There was another file with wrong data