Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Do not fetch from video sources #88

Closed
nateRiver111 opened this issue Jul 7, 2022 · 14 comments
Closed

Do not fetch from video sources #88

nateRiver111 opened this issue Jul 7, 2022 · 14 comments
Labels
enhancement New feature or request

Comments

@nateRiver111
Copy link

Feature description

If possible to add an option to always prefer non video sources to fetch and stream songs from.

Why do you want this feature?

Songs from video sources tend to add extra dialogue and scenes that delay and interrupt the songs and in an audio only app can get annoying.

Additional information

When you search in the song category is all fine but if you switch to album then it fetch it from a video source and one you start radio from a video source it's all video

@nateRiver111 nateRiver111 added the enhancement New feature or request label Jul 7, 2022
@vfsfitvnm
Copy link
Owner

but if you switch to album then it fetch it from a video source

Yes, this true and painful - but unfortunately I couldn't find a way to find the corresponding videoId of a song, given the videoId of its video. I tried playing with many parameters, but unfortunately none of them worked 😞

@vfsfitvnm
Copy link
Owner

The good part is I know if a media is from a video (MUSIC_VIDEO_TYPE_OMV, MUSIC_VIDEO_TYPE_UGC) or a song (MUSIC_VIDEO_TYPE_ATV).

@vfsfitvnm
Copy link
Owner

The problem is not about the video section - but albums may contain video sources even if the song counterpart exists

@alonscheuer
Copy link

I know that NewPipe is somehow able to fetch only audio versions for albums - not sure if this app uses the same extractor or not, but maybe its helpful anyway!

@vfsfitvnm
Copy link
Owner

Thanks! Given the same album (same playlistId):

  • music.youtube.com returns video sources;
  • www.youtube.com returns song sources.

(lol)

That's why NewPipeExtractor returns the audio sources

@vfsfitvnm
Copy link
Owner

Another finding:
Using the YTM Android app, albums still has videos id, but when playing they switch to audio sources (but video id, title etc are the ones of the video)

@vfsfitvnm
Copy link
Owner

vfsfitvnm commented Jul 8, 2022

The quickest solution consists in fetching the album videos from an invidious/piped instance and then replace the video ids returned by ytm with the ones we just obtained (comparing by title and index to avoid problems)

@vfsfitvnm
Copy link
Owner

You can try this feature here by downloading the apk: https://github.com/vfsfitvnm/ViMusic/suites/7275367261/artifacts/292904270.

Please let me know if it works correctly

@nateRiver111
Copy link
Author

Definitely an improvement but some songs still fetch the video source. Enemy from the album Mercury : Acts 1 & 2 does it for example.

Also already cached album info doesn't upgrade to new videoid

@vfsfitvnm
Copy link
Owner

vfsfitvnm commented Jul 8, 2022

Hmm, that happens because of a title mismatch (Enemy vs Enemy (from the series Arcane League of Legends)),

Piped returns the latter, but ViMusic returns the former - the cause seems to be the hl parameter, which decodes the client language. If I set to en, then there's a mismatch...

I think I could just check against the index, but it looks risky

@nateRiver111
Copy link
Author

I was snooping around and checking against the index seems that would work.

The other thing I can think of is measuring the length of title names and checking if the shorter is contained in the largest. That should solve most of songs with title mismatch but it's case sensitive I have encountered songs that returned id from a video source because a lowercase letter.

@vfsfitvnm
Copy link
Owner

I think the index is fine, then: I was worried about some videos not being available, but fortunately piped shows them anyway (like YTM does, example).

@nateRiver111
Copy link
Author

Tested all the songs I had marked down and all of them loaded the audio version. I don't know a playlist with a non available song in the middle so I could test what was worrying you but as you said piped indexed those songs too so shouldn't be a problem. I think the issue can be closed now.

Thank you for your awesome work❤️

PS: how doable is a button to refetch album info. The albums that I have already in cache are showing the video version of the songs. I know the app is in development and this things are supposed to happen and guess not many people are going to use it so I don't know if I should open an issue about it.

@vfsfitvnm
Copy link
Owner

Yep, the refetch button is planned

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants