-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
base: master
Are you sure you want to change the base?
Conversation
good :) , but it need something like ""newpipe"" sub export |
…tWith('favicon'), try with feed https://lukesmith.xyz/rss.xml for an example)
…hannel icon instead of youtube logo. Modular features which only implements youtube at the moment
Automatically fetch custom favicons
Added option in preferences to use 'custom icons when available'. 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. Also added some minor changes to fetch default favicon. |
There was a problem hiding this 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" |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same internationalization suggestion here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gkd 👍
Is it possible to merge ? It would be great if so, a lot of people would benefit from this imho |
any update on this :) ? |
@yang991178 But, I took what was started and fixed the issues (i.e. current conflicts) + the comments you mentioned in my fork.
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:
|
It would be awesome if this could be fixed up and merged into main. |
when fix and merge??? |
likes == gillar |
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:
The implementation supports both individual channel feeds as well as playlist feed.
Changes in GUI:
As I'm not familiar with the codebase some tweaking and optimizing should probably be performed.