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

Video description not keeping the \n #54

Open
CypElf opened this issue Apr 4, 2021 · 4 comments
Open

Video description not keeping the \n #54

CypElf opened this issue Apr 4, 2021 · 4 comments
Labels
enhancement New feature or request not a bug wontfix/deprecated This will not be worked on

Comments

@CypElf
Copy link

CypElf commented Apr 4, 2021

When searching for videos and looking at one's description attribute, we can see the line feeds are not kept. They are instead replaced with spaces. Is it the expected behavior, and if so, how to get the original description with the line feeds?

@talmobi talmobi self-assigned this Apr 4, 2021
@talmobi
Copy link
Owner

talmobi commented Apr 4, 2021

Hello there,

Can you provide an example search term on youtube that has search results with this working as expected?

@talmobi
Copy link
Owner

talmobi commented Apr 4, 2021

I think youtube intentionally only provides a small limited view of the video description in the search results.

If you want the full description, you should try making another request for that specific video's metadata which should contain it in full and include newlines etc.

example: https://runkit.com/talmobi/runkit-npm-yt-search-video

@CypElf
Copy link
Author

CypElf commented Apr 5, 2021

It seems to be the case with all videos, but it happens for example with this one.
Fetching again the informations about the specific video is a good workaround, however it means 2 requests are needed, which are not instant. Is it a limitation of YouTube's API ? I didn't really look into that.

@talmobi
Copy link
Owner

talmobi commented Apr 5, 2021

This library does not use the YouTube API at all.

It uses the same requests that you would make when you open youtube as a user. This is why when you enter a search term, you get the results with minimal description -- because that's how it looks like when you search for something on youtube.

Your example is a specific video, not general search results.

For example compare the search results for the search term "hiroyuki sawano" https://www.youtube.com/results?search_query=hiroyuki+sawano

All of these results have minimal descriptions without newlines etc.

These are the kind of results that this library returns, it does not use the YouTube API at all.

If you need more thorough results you should try using YoutTube's own API.

@talmobi talmobi added enhancement New feature or request not a bug wontfix/deprecated This will not be worked on labels Apr 5, 2021
@talmobi talmobi removed their assignment Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request not a bug wontfix/deprecated This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants