{"action":"created","issue":{"url":"https://api.github.com/repos/v1k45/python-qBittorrent/issues/6","labels_url":"https://api.github.com/repos/v1k45/python-qBittorrent/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/v1k45/python-qBittorrent/issues/6/comments","events_url":"https://api.github.com/repos/v1k45/python-qBittorrent/issues/6/events","html_url":"https://github.com/v1k45/python-qBittorrent/issues/6","id":127998387,"number":6,"title":"Unsupported Media Type error when attempting to download_from_file","user":{"login":"jerblack","id":5771102,"avatar_url":"https://avatars.githubusercontent.com/u/5771102?v=3","gravatar_id":"","url":"https://api.github.com/users/jerblack","html_url":"https://github.com/jerblack","followers_url":"https://api.github.com/users/jerblack/followers","following_url":"https://api.github.com/users/jerblack/following{/other_user}","gists_url":"https://api.github.com/users/jerblack/gists{/gist_id}","starred_url":"https://api.github.com/users/jerblack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerblack/subscriptions","organizations_url":"https://api.github.com/users/jerblack/orgs","repos_url":"https://api.github.com/users/jerblack/repos","events_url":"https://api.github.com/users/jerblack/events{/privacy}","received_events_url":"https://api.github.com/users/jerblack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-21T19:14:44Z","updated_at":"2016-01-21T19:47:37Z","closed_at":null,"body":"We got past the last error, but now I'm getting a new one\r\n\r\n```python\r\ntor = r\"C:\\Torrents\\add_torrent\\sample2.torrent\"\r\nf = open(tor)\r\no.qb.download_from_file(f, label='comics')\r\n```\r\nThis gives the following error\r\n\r\n```python\r\nTraceback (most recent call last):\r\n  File \"C:\\Torrents\\utilities\\qbittorrent_port_updater.py\", line 115, in <module>\r\n    start()\r\n  File \"C:\\Torrents\\utilities\\qbittorrent_port_updater.py\", line 43, in start\r\n    nt.check(o)\r\n  File \"C:\\Torrents\\utilities\\qbittorrent_port_updater.py\", line 98, in check\r\n    o.qb.download_from_file(f, label='comics')\r\n  File \"C:\\Python27\\lib\\site-packages\\qbittorrent\\client.py\", line 325, in download_from_file\r\n    return self._post('command/upload', data=data, files=torrent_files)\r\n  File \"C:\\Python27\\lib\\site-packages\\qbittorrent\\client.py\", line 46, in _post\r\n    return self._request(endpoint, 'post', data, **kwargs)\r\n  File \"C:\\Python27\\lib\\site-packages\\qbittorrent\\client.py\", line 70, in _request\r\n    request.raise_for_status()\r\n  File \"C:\\Python27\\lib\\site-packages\\requests\\models.py\", line 840, in raise_for_status\r\n    raise HTTPError(http_error_msg, response=self)\r\nrequests.exceptions.HTTPError: 415 Client Error: Unsupported Media Type for url: http://torrent:8080/command/upload\r\n```"},"comment":{"url":"https://api.github.com/repos/v1k45/python-qBittorrent/issues/comments/173688378","html_url":"https://github.com/v1k45/python-qBittorrent/issues/6#issuecomment-173688378","issue_url":"https://api.github.com/repos/v1k45/python-qBittorrent/issues/6","id":173688378,"user":{"login":"v1k45","id":7877501,"avatar_url":"https://avatars.githubusercontent.com/u/7877501?v=3","gravatar_id":"","url":"https://api.github.com/users/v1k45","html_url":"https://github.com/v1k45","followers_url":"https://api.github.com/users/v1k45/followers","following_url":"https://api.github.com/users/v1k45/following{/other_user}","gists_url":"https://api.github.com/users/v1k45/gists{/gist_id}","starred_url":"https://api.github.com/users/v1k45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/v1k45/subscriptions","organizations_url":"https://api.github.com/users/v1k45/orgs","repos_url":"https://api.github.com/users/v1k45/repos","events_url":"https://api.github.com/users/v1k45/events{/privacy}","received_events_url":"https://api.github.com/users/v1k45/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T19:47:37Z","updated_at":"2016-01-21T19:47:37Z","body":"The content-type ``application/x-bittorrent`` is the [MIME-Type](https://en.wikipedia.org/wiki/MIME) of the torrent file. Every torrent file is supposed to have it in its headers. And it automatically set as content-type when doing web uploads.\r\n\r\nThe most probable cause of the error is that you're generating these torrents by yourself or are using outdated tools. Almost every torrent file has this MIME Type.\r\n\r\nYou can check the MIME of the file you are trying using this [SO Answer](http://stackoverflow.com/a/2133843/4726598)"}}