Fix upload
This commit is contained in:
parent
f7761a0e49
commit
09c10beb8a
2 changed files with 3 additions and 2 deletions
|
|
@ -35,7 +35,7 @@ class TestYTMusic(unittest.TestCase):
|
|||
|
||||
def test_upload_song(self):
|
||||
response = youtube_auth.upload_song('../12 - Turning Point.mp3')
|
||||
self.assertEqual(response, 'OK')
|
||||
self.assertEqual(response, 'STATUS_SUCCEEDED')
|
||||
|
||||
def test_delete_uploaded_song(self):
|
||||
results = youtube_auth.get_uploaded_songs()
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class YTMusic:
|
|||
|
||||
"""
|
||||
self.auth = auth
|
||||
|
||||
file = auth if auth else pkg_resources.resource_filename('ytmusicapi', 'headers.json')
|
||||
with open(file) as json_file:
|
||||
self.headers = json.load(json_file)
|
||||
|
|
@ -441,7 +442,7 @@ class YTMusic:
|
|||
files={'file': file},
|
||||
headers=headers)
|
||||
prepped = req.prepare()
|
||||
filesize = str(int(prepped.headers['content-length']) -500)
|
||||
filesize = prepped.headers['content-length']
|
||||
|
||||
body = "filename=" + ntpath.basename(filepath)
|
||||
headers['content-type'] = 'application/x-www-form-urlencoded;charset=utf-8'
|
||||
|
|
|
|||
Loading…
Reference in a new issue