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

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

langballe
Copy link

@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

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
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
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.

@@ -183,6 +190,13 @@ class AppTab extends React.Component<AppTabProps, AppTabState> {
</Stack.Item>
</Stack>

<Toggle
label="Use custom icons when available"
Copy link
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.

@@ -31,7 +32,8 @@ class AppTab extends React.Component<AppTabProps, AppTabState> {
themeSettings: getThemeSettings(),
itemSize: null,
cacheSize: null,
deleteIndex: null
deleteIndex: null,
iconStatus: window.settings.getIconStatus()
Copy link
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?

@@ -121,6 +148,13 @@ export function htmlDecode(input: string) {
return doc.documentElement.textContent
}

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
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.

Choose a reason for hiding this comment

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

gkd 👍

@OzakIOne
Copy link

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

@bingoxo
Copy link

bingoxo commented Nov 18, 2021

any update on this :) ?

@martingem
Copy link

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

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

@shadow-absorber
Copy link

when fix and merge???

@shadow-absorber
Copy link

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

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.

9 participants