Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to upload songs #1

Closed
ccyang2019 opened this issue Apr 3, 2020 · 5 comments
Closed

Fail to upload songs #1

ccyang2019 opened this issue Apr 3, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@ccyang2019
Copy link

I tried to use this API to upload songs to youtube music. But always fail to do that.

#!/usr/bin/env python3
# -*- coding:UTF-8 -*-
import os
from ytmusicapi import YTMusic
ytmusic = YTMusic('yt_header.json')
file = "test.mp3"
status=ytmusic.upload_song(file)
print(status)

I got return status "STATUS_SUCCEEDED", but I fail to see my uploaded song in youtube music.

200
{'X-GUploader-UploadID': 'AEnB2UpJYZnMeaGnKkJuNPM1Q75X5WaFXkxO8BGfxtUcxjN7tAqhIJysFn3CF5c0zsd2iGteKHcsN87KGhA-qEG-6NMpcnB0i1qEHxyyvOeYh4MSChuPVd4', 'X-Goog-Upload-Status': 'final', 'Content-Length': '0', 'Date': 'Fri, 03 Apr 2020 07:48:50 GMT', 'Server': 'UploadServer', 'Content-Type': 'text/html; charset=UTF-8'}

I tried to do some fail experiments and the return status is always "STATUS_SUCCEEDED"

  • wrong headers_auth.json value in Authorization field
  • upload a mp4 file
  • upload the same song
@sigma67
Copy link
Owner

sigma67 commented Apr 3, 2020

Hey, please make sure you're using the latest version 0.5.1. There was a bug with uploads in 0.5. In particular, there is now an authentication check when providing auth headers, which should have triggered on the first of your fail tests.

I tested the code you posted and it worked fine for me, so there is no issue with it. There is also a processing delay, so your song should first show up as "processing" in the songs section of your library.

As for mp4 files and same songs, the library currently does not check this. Duplicates can be uploaded without issues. So make sure your file is correct.

@ccyang2019
Copy link
Author

yes. thanks for your comment.
It should be working now. Change another account with less uploaded songs to debug this issue. I can see my uploaded mp3 songs now. It takes several minutes to process my uploaded songs.
image
But I still have following issues under debugging:

  1. only mp3 song works. my ".m4a", and ".flac" songs uploaded and show processing, then after several minutes no showed in the uploaded list.
    As attached, the 2 song processing in above picture, which are not showed in the uploaded list after several minutes.
    image

  2. duplicated songs not detected like web upload flow.

  3. mp3 tag like "album", "title" are lost after uploaded. it's ok by web upload .
    image

@sigma67
Copy link
Owner

sigma67 commented Apr 4, 2020

Hey, thanks for bringing up these issues. They are valid.

  1. I have not tested this with other file formats. Let me know if you're able to figure out the issue. Do m4a and flac work on the web UI?
  2. The web upload flow only detects duplicates after the upload. Not sure why they're not detected when uploading with the library. It might have something to do with the additional 'OPTIONS' calls that the web UI does, which I left out since it worked without them. I'll look into this.
  3. I'm not sure why mp3 tags and album picture are lost when uploading with the library function. Might also be related to the OPTIONS calls.

Let me know if you've done any additional experiments or reverse engineered something successfully.

@sigma67 sigma67 added the bug Something isn't working label Apr 4, 2020
@sigma67
Copy link
Owner

sigma67 commented Apr 12, 2020

Hey, just letting you know that I've found the problem. Files should now be uploaded correctly. All three issues should be fixed in the latest version v0.5.2

@ccyang2019
Copy link
Author

Hi sigma67,

yes. my issue is solved in v.0.5.2. I can upload my *.flac files successfully now.

thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants