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

Issue while reading playlists #52

Open
natsukashiixo opened this issue Jun 1, 2023 · 14 comments
Open

Issue while reading playlists #52

natsukashiixo opened this issue Jun 1, 2023 · 14 comments
Labels
bug Something isn't working network Everything related to network

Comments

@natsukashiixo
Copy link

This will most likely not end up being relevant but I'll include it anyway:
OS: Arch Linux x86_64
Install method: cloned from repo, built using rustup 1.26.0-3

Actual issue and question:
I'm able to launch ytermusic without any errors being thrown but my personal playlists aren't showing up at all.
Instead I get generic suggestions for people in my region, this makes me feel like I'm not actually logged in but I have no idea if its possible to check.

Am I supposed to copy the cookie from a specific request on music.youtube.com? Currently I have copied the string from the first music.youtube.com request that pops up after refreshing the page. Aka the cookie: field under Request Headers.

My account is using security key 2fa, my assumption is that this doesn't matter since it should pass if the cookie is valid. My browser is Brave.
Obviously I won't post my cookie string, but I assume that user agent is fine. This is the general spec of my headers.txt
Cookie: VERYLONGCOOKIESTRING
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Each field is on a separate line.

@ccgauche
Copy link
Owner

ccgauche commented Jun 2, 2023

Should be good from what I can tel. May you send the log file? Maybe something went wrong when decoding your library.

@natsukashiixo
Copy link
Author

[PERF] Init: 0ms [PERF] Startup: 0ms [PERF] Spawned clean task: 0ms [PERF] Clean task: 0ms [PERF] Spawned system task: 77ms [PERF] Spawned last playlist task: 77ms [PERF] Spawned api task: 78ms [PERF] Running manager: 78ms Last playlist task on [PERF] Last playlist: 0ms API task on Database getter task on [PERF] Local musics: 0ms [PERF] API task: 3035ms [PERF] Browse playlist Call on Me (David Guetta Remix): 338ms [PERF] Browse playlist A Beautiful Game: 360ms [PERF] Browse playlist Puls: 369ms [PERF] Browse playlist Aeroplane: 427ms [PERF] Browse playlist Hero [VIP Mix]: 417ms [PERF] Browse playlist Almost Healed: 411ms [PERF] Browse playlist Plava Krv: 428ms [PERF] Browse playlist She's the One: 563ms [PERF] Browse playlist New Release Mix: 792ms [PERF] Browse playlist Discover Mix: 1414ms [PERF] Browse playlist My Supermix: 1475ms [PERF] Browse playlist Beach Beats: 1573ms [PERF] Browse playlist Tollywood Hitlist: 1661ms [PERF] Browse playlist Bollywood Hitlist: 1672ms [PERF] Browse playlist Summer Dance Classics: 1708ms [PERF] Browse playlist Easy EDM: 1675ms [PERF] Browse playlist Soft Rock Ballads: 1702ms [PERF] Browse playlist Modern Ukrainian Pop: 1688ms [PERF] Browse playlist Classical Focus: 1716ms [PERF] Browse playlist Country Hotlist: 1775ms [PERF] Browse playlist Ultimate Summer Hits: 1788ms [PERF] Browse playlist All-Time Easy Acoustics: 1754ms [PERF] Browse playlist Relaxing 80s Rock: 1766ms [PERF] Browse playlist RELEASED: 1804ms [PERF] Browse playlist The Hit List: 1813ms [PERF] Browse playlist Al Millón: 1793ms [PERF] Browse playlist Reggae Relaxation: 1793ms [PERF] Browse playlist Hip Hop + R&B Summer Hits: 1842ms [PERF] Browse playlist Hip-Hop Classics: 1821ms [PERF] Browse playlist Pop Gold: 1840ms [PERF] Browse playlist Gentle Piano: 1859ms [PERF] Browse playlist Totally Pop: 1861ms [PERF] Browse playlist Golden Gods of Metal: 1880ms [PERF] Browse playlist Biggest Dance Anthems: 1886ms [PERF] Browse playlist Summer Hits 2023: 1946ms [PERF] Browse playlist Highline R&B: 1945ms [PERF] Browse playlist Summer Trappin: 1953ms [PERF] Browse playlist Sunshine Reggae: 1960ms [PERF] Browse playlist BEAT ON: 1968ms [PERF] Browse playlist Summer House: 1968ms [PERF] Browse playlist Glow: Dance Hits: 1971ms [PERF] Browse playlist Chroma: Today's Dance Hits: 1972ms [PERF] Browse playlist Pop's Biggest Hits: 1934ms [PERF] Browse playlist Totally Hits: 1934ms [PERF] Browse playlist Sunshine Indie: 1993ms [PERF] Browse playlist Unstoppable Rock Anthems: 1944ms [PERF] Browse playlist Huge Dance Hits: 1947ms [PERF] Browse playlist Classic Easy Rock: 1967ms [PERF] Browse playlist The Arijit Singh Collection: 2049ms [PERF] Browse playlist Laid Back Summer: 2173ms [PERF] Browse playlist Easy Modern Soul: 2146ms Appended [Blue Archive] Unwelcome School (Seamless 30m) to database panicked at 'index out of bounds: the len is 158 but the index is 158', /home/ntsu/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.17.0/src/buffer.rs:176:14

This is from my latest launch, can't see anything weird except the last line.
None of the playlists listed in this log are mine except Local Musics of course. Let me know if there's any way to generate a more detailed log

@ccgauche
Copy link
Owner

ccgauche commented Jun 5, 2023

Seems strange very strange indeed may you remove your database from your config files? (You can remove all of them)
You can also run RUST_BACKTRACE=1 cargo run --release to get more details about the last panic.

@natsukashiixo
Copy link
Author

the panic didn't happen at my latest launch, feels like it might be related to the 30min long song instead of this cookie issue, so i'll hold off on investigating it for now.

Keep in mind that while i might seem to know what I'm doing, I'm quite new to linux, anyways:
I can't find the database files in my ~/.config folder. Is that where they're supposed to be located?
Maybe I should also elaborate on my installation in case my steps messed something up. Cloned from git into ~/ytermusic, built in that folder and then mkdir ~/ytermusic-bin, copied the bin into there, generated my headers.txt and now I'm running it with ./ytermusic from inside the ytermusic-bin folder. The reason I did this is because I don't want to populate my .cargo/bin folder with anything but binaries.

I decided to check the permissions of the files in case those are wrong but unless ytermusic is run as a group idk.
.rwxr-xr-x ntsu ntsu 94 MB Thu Jun 1 10:50:44 2023  ytermusic

@ccgauche
Copy link
Owner

ccgauche commented Jun 5, 2023

I doesn't seem to be an issue with your config file. YTermusic would launch if so. Something in one of your playlists is probably disabling YterMusic from reading them (Maybe some sort of specific encoding)

@ccgauche
Copy link
Owner

ccgauche commented Jun 5, 2023

Already had a bug like that which was caused by a foreign layout that wasn't expected ("Arabic" since it's right to left)

@natsukashiixo
Copy link
Author

natsukashiixo commented Jun 5, 2023

A lot of my playlists have names in japanese, so yeah, starting to sound like the most likely reason. My username (but not handle) is also in japanese, which might also explain why even the playlists that don't have japanese names don't show up. Funky!

edit: Should i change the name of the Issue so it can be recategorized as a bug?

@ccgauche ccgauche changed the title Trouble finding the right cookie to pass Issue while reading playlist Jun 6, 2023
@ccgauche ccgauche changed the title Issue while reading playlist Issue while reading playlists Jun 6, 2023
@ccgauche ccgauche added bug Something isn't working network Everything related to network labels Jun 6, 2023
@ccgauche
Copy link
Owner

ccgauche commented Jun 6, 2023

@natsukashiixo I added some further logging, tracing and debugging that can be enabled using YTERMUSIC_LOG=true cargo run --release on the lastest commit. If you can send me the output.

@natsukashiixo
Copy link
Author

The log file ended up being 83MB so I had to use a separate upload service for it. https://file.io/dquNFeylUGNA

@ccgauche
Copy link
Owner

ccgauche commented Jun 6, 2023

@natsukashiixo May you check if the issue is fixed ?

@natsukashiixo
Copy link
Author

https://file.io/4ixQdVaG8hwr
Doesn't seem like its fixed sadly

@ccgauche ccgauche reopened this Jun 6, 2023
@PatOConnor43
Copy link

I ran into a slightly related issue where I was using an old cookie that was no longer valid. This resulted in only getting playlists as if I wasn't logged in. I tried copying my new cookie into the headers.txt file but kept getting an InvalidCookie error from this line:
https://github.com/ccgauche/ytermusic/blob/master/ytpapi2/src/lib.rs#L175

The to_str function fails if the string contains non-ascii characters. I used this website to identify non-ascii characters in my cookie:
https://pages.cs.wisc.edu/~markm/ascii.html

Turns out I had a unicode ellipses in my cookie because of how I copied it from the dev tools 😆

Once I copied the actual value, everything worked perfect. Not sure if you somehow ran into the same problem I did 😅

@ccgauche
Copy link
Owner

ccgauche commented Jul 3, 2023

I'll probably add some sort of check if it can avoid misuse by users.

@natsukashiixo
Copy link
Author

"No non-ascii characters found" when I used that checker, but my playlists still aren't appearing. Might look into forking and trying to add a netscape format cookie jar but I've never worked with Rust before and its a bit intimidating

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

No branches or pull requests

3 participants