FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Support for youtube playlist imports in cvs

Open Sp3rick opened this issue 1 year ago • 5 comments

Main Change: Support for youtube playlist imports in cvs

Others: moved some code to parseCsv added updatePlaylistVideo for update single playlist video on database added preference.js to get unique dataset results using the preferred api

Title

Pull Request Type

  • [ ] Bugfix
  • [x] Feature Implementation
  • [ ] Documentation
  • [ ] Other

Related issue

Description

Screenshots

Testing

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

Sp3rick avatar Jul 29 '24 19:07 Sp3rick

I have not reviewed the code or tested this pull request yet, however I have noticed that you haven't filled in the pull request template properly including the rather important testing section which for something like this should also include example files that reviewers can use to test the pull request.

absidue avatar Jul 29 '24 20:07 absidue

This could potentially close #5057

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Aug 01 '24 12:08 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Aug 13 '24 10:08 github-actions[bot]

I have not tested this but looking at the code alone this pull request looks like it'll require an overhaul before it could be merged.

  • The playlists.csv file contains all the metadata about the playlists, from what I can tell this pull request doesn't have any logic for that. It would probably be better to create a separate button for the YouTube playlists import, then prompt the user to selected the metadata file first and then afterwards prompt them to select the csv files for the playlists they want to import.
  • You should avoid making requests to YouTube as much as possible, during an import like this you'll likely be sending hundreds if not thousands of requests in rapid succession, which will most certainly get you ratelimited or worse (the subscriptions import already has that problem and that only makes one request per channel, which is why in the long term we want to refactor the subscriptions import to not make any requests at all). Before doing any requests you should be checking every possible cache and store (e.g. watch history, existing playlists, subscriptions cache, search cache, trending cache, popular cache etc), making requests to YouTube or Invidious should be the last resort.
  • While your preferences.js idea sounds great on paper, in practice it means that with the local API for example you'll be making about 6 requests per video (more in the future once we add support for YouTube's poToken stuff). For the import you only need one request per video because you only need a few metadata fields, whereas the watch page needs to create a real session on YouTube, make extra requests to get playable streaming URLs, fetch the full description and recommended videos, as well as attempt to bypass age-restrictions. For the local API you should be creating a dedicated function that calls YouTube.js' getBasicInfo function).

absidue avatar Aug 21 '24 05:08 absidue

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Sep 02 '24 01:09 github-actions[bot]

This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Oct 08 '24 01:10 github-actions[bot]

This PR was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar Oct 22 '24 01:10 github-actions[bot]