You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 31, 2021. It is now read-only.
If an error is encountered at some point, save the partial data to the file with "nextPageToken" being set.
If the user runs the same command again, check if the "nextPageToken" is not empty, and if so resume the operation using it.
And some notes about this approach:
"nextPageToken": null means everything is successfully downloaded.
On step 2 above, when there is an error, the script can actually make a second try before failing and saving partial data.
To decrease the chance of error, there may be delay between requests (in fact I looked at the source code to see if this is already done but failed; because JS code, to me, is very hard to follow)
Youtube API sometimes may return error pages (such as #47) or simply a network error may break the whole fetching process.
To overcome this, I'll kindly propose the below approach:
Turn the scheme into something like this:
{ "comments": [ // ... ], "numberOfTotalComments": 2300, "nextPageToken": null }If an error is encountered at some point, save the partial data to the file with "nextPageToken" being set.
If the user runs the same command again, check if the "nextPageToken" is not empty, and if so resume the operation using it.
And some notes about this approach:
"nextPageToken": nullmeans everything is successfully downloaded.