Import YouTube history into the rate later list#2059
Conversation
|
Also, I added a button to the extension dropdown but it only opens a tab to the watch history, so I'm not sure it's useful. |
|
The videos that are already in the rate-later list appear as successfully imported, sounds good to me. |
Should we add the bulk import before releasing a first version of this feature? What do you think @amatissart ? Without the bulk import, the API allows authenticated users to make 120 requests per minute. This is very tight for an import process. If we decide to release a first version without the bulk import, we may want to manually control the pace of the import. I just lock myself out of tournesol.app by clicking five times on the import button. After that all import attempts fail : ] |
OK
OK I'll try that.
The title is indeed needed. A loading animation would really convey that something is happening. Maybe one of the CC0 pure CSS animations at https://loading.io/css/? Or maybe even a description of the process and a "start" button?
It doesn't seem very difficult to add the bulk import, so it's probably better to wait for it. I think I'll make the current API also accept an array of IDs as input. But if you'd rather have a new entry point, tell me. I don't know how heavy this process is to the backend. If it is, we may want a custom rate limit for this specific call (and that may warrant a specific entry point). The current version of the feature will do a call 1 second after the last request completed. |
c12170f to
2f7b639
Compare
|
I made all the changes. It should work well, with a bulk import. I ended up using a specific API endpoint, but it can probably be merged into the existing create endpoint. |
|
Thank you very much, I'll have a look tomorrow. |
|
Hello @sigmike I created a new PR #2063 that targets this branch to add the following features:
The animation you chose is great.
I think it's not necessary because the users already need to click on the Import button to trigger the import. One click seems enough to me.
Adding a new entry point is good for now. As @amatissart said here #2059 (comment) and there #2059 (comment) we should limit the number of videos that can be added at the same time by the API. This will make the process more robust by avoiding timeout, and also will give us more control on how we manage the calls to the YouTube API. 20 videos per batch sounds good to me. |
|
Ok, thanks for the suggestions. I'll implement that. |
Co-authored-by: Adrien Matissart <a@matissart.net>
Co-authored-by: Adrien Matissart <a@matissart.net>
e189772 to
a92679c
Compare
|
Minus the two previous comments, the PR looks good to me, thanks a lot @sigmike (1) about the YouTube API calls @amatissart before merging should we consider defining a new strategy to limit the number of YouTube API generated by the history imports? Random ideas:
In the future we may want to consider using a task queue, to spread the API calls over the whole day while saving some credits for our daily routines like the playlist updates. (2) about users that will import several times their history It will possible for a user to import several times his/her history to Tournesol. It will also be possible that subsequent imports will re-add videos to the rate-later list that have been automatically removed after 4 comparisons. This will, for instance, make the suggestions made by the Auto button less relevant, because it could suggest videos the users don't want to compare. In my opinion it's not a blocking point to merge this PR, but it could be useful to have a solution for that. Ideas:
I have a preference for the solution "by default import everything but allow the users to "clean" their rate-later..." |
Co-authored-by: Gresille & Siffle <39056254+GresilleSiffle@users.noreply.github.com>
|
We created a new PR that targets this one (here #2064) to address the point (1) of #2059 (comment). Regarding the point (2) we haven't fully decided yet. |
…-later API (#2064) * fix: http 429 not properly detected --------- Co-authored-by: Adrien Matissart <a@matissart.net>
…2068) * [ext] feat: keep improted videos in cache to not import them again * [ext] feat: display a more visible alert when a HTTP 429 is received * [ext] refactor: simplify a CSS margin declaration * [ext] chore: remove useless console.log * [ext] fix: wrong english title in the import status box * [ext] ui: simplify alert message in the import status box
|
Let's not forget this comment #2068 (comment) I'll have time tomorrow. |
* menu: replace 'browser' namespace not supported by Chrome * fix response on addRateLaterBulk, as Chrome does not support Error when passing messages * fix error in addRateLaterHistoryButton when history page is first page in YouTube session * revert slash in url * fix lint

Description
Initial draft to import your watch history into your rate later list.
The bulk import is not done yet, so the import is very slow, but it works.
Remaining to do: