Skip to content

Added YouTube parser for thumbnail, content, snippet and other metadata.#297

Open
langballe wants to merge 4 commits intoyang991178:masterfrom
langballe:youtube-parser
Open

Added YouTube parser for thumbnail, content, snippet and other metadata.#297
langballe wants to merge 4 commits intoyang991178:masterfrom
langballe:youtube-parser

Conversation

@langballe
Copy link
Copy Markdown

@langballe langballe commented Aug 8, 2021

Proper parsing of youtube feeds is not currently supported.
Thumbnail, content or snippet does not get parsed.
Added "['media:group', 'videoMeta', {keepArray: false}]" to customfields in rss feader, so video metedata can be parsed.
This patch parses:

  • Thumbnail
  • Snippet (description)
  • Content (embedded video, amount of views and likes, and description)

The implementation supports both individual channel feeds as well as playlist feed.

Changes in GUI:
fluent1
fluent2

As I'm not familiar with the codebase some tweaking and optimizing should probably be performed.

@aagradwan
Copy link
Copy Markdown

good :) , but it need something like ""newpipe"" sub export

Martin Langballe and others added 3 commits August 15, 2021 01:41
…hannel icon instead of youtube logo. Modular features which only implements youtube at the moment
Automatically fetch custom favicons
@langballe
Copy link
Copy Markdown
Author

Added option in preferences to use 'custom icons when available'.
This is meant to be a modular feature which automatically fetches images (favicons) if user doesn't wish to use the default one.

YouTube is an example, where instead of the YouTube logo, the new functionally makes a new request to the users channel (only channel feed, not playlists) and pulls the avatar image.

Only YouTube is currently supported, but more modules can easily be added in scripts/utils.ts

The modular functionality would benefit from a rework, but this build is and stable working.

preferences

Also added some minor changes to fetch default favicon.

Copy link
Copy Markdown
Owner

@yang991178 yang991178 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. This seems to be 2 separate features (parse youtube content and fetch youtube icons) to me though and should ideally be split into 2 PRs.

</Stack>

<Toggle
label="Use custom icons when available"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All strings should be extracted for internationalization.

cacheSize: null,
deleteIndex: null
deleteIndex: null,
iconStatus: window.settings.getIconStatus()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use a better variable name here and below for iconStatus that includes "youtube" to make this clearer?

Comment thread src/scripts/utils.ts

export function parseYouTubeContent(url: string, views: string, likes: string, content: string){
const video = `<iframe width="560" height="315" src="${url}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`
const views_likes = `<p style="float: left; color: #808080;"><em>${views} views</em></p><p style="float: right; color: #808080;"><em>${likes} likes</em></p>`
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same internationalization suggestion here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gkd 👍

@OzakIOne
Copy link
Copy Markdown

Is it possible to merge ? It would be great if so, a lot of people would benefit from this imho

@bingoxo
Copy link
Copy Markdown

bingoxo commented Nov 18, 2021

any update on this :) ?

@martingem
Copy link
Copy Markdown

martingem commented Oct 28, 2022

@yang991178
Hello, I'm not sure if this PR is dead.

But, I took what was started and fixed the issues (i.e. current conflicts) + the comments you mentioned in my fork.
List:

  • I took @langballe's work, fixed the conflicts
  • Added the i18n stuff
  • For

Could we use a better variable name here and below for icon status that includes "youtube" to make this clearer?

I'm sure that there could be other use cases where the icon could be modified to make the UI/UX neat. Would you prefer to have this a YouTube-specific Toggle, then? Or more like now where if the source has the capability of having an alternative icon, to use it?

Next steps:

@ThomasHineXYZ
Copy link
Copy Markdown

It would be awesome if this could be fixed up and merged into main.

@shadow-absorber
Copy link
Copy Markdown

when fix and merge???

@shadow-absorber
Copy link
Copy Markdown

likes == gillar
in swedish
views is not easily directly translated

@copiliot-cmd
Copy link
Copy Markdown

Hi there i know this pr is probably dead but is there any updates on this. i think it would be extremely useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants