If you have any issues with this script, do not open any issues on the main TA repo regarding this script. Open the issue here.
In Tube Archivist ~4.x (found here https://github.com/tubearchivist/tubearchivist ), you may want to prioritize many videos in your download queue. At this time you have to manually click "download now" once you've filtered by a certain channel. This simple script automates the clicking, and you can prioritize an entire channel in a short time. This script goes in an inspection console and executes.
First, Go to your settings page and change the number of archive results to a number you want to process at a time. (I chose 100.)
Second go to your downloads page. Then use the dropdown to choose a particular channel you'd like to move towards the top of the download queue. Note that the exact order might not be retained, especially if you have other things you've already "prioritized". In my experience the exact behavior is not LIFO, but rather LIFO with some grouping by channel. In any case, you can move scores of queued videos upwards in the queue without clicking each one.
Make sure you are looking at the inspection of the download page you just filtered.
Find the javascript code in this repo and copy it to your clip board. (Here it is)
// Custom :contains selector
function contains(selector, text) {
const elements = document.querySelectorAll(selector);
return Array.from(elements).filter(element => RegExp(text).test(element.textContent));
}
// Get all buttons with the text "Download now"
const downloadButtons = contains('button', 'Download now');
// Click each button with a delay of 1/5 second
downloadButtons.forEach((button, index) => {
setTimeout(() => {
button.click();
console.log(`Clicked button with text: "${button.textContent}" and id: "${button.id}"`);
}, index * 200); // 1000 milliseconds = 1 second
});
You can adjust the time it sleeps between clicking. I have mine set to 200ms, i.e. 1/5 of a second.
You'll then see it start to process. There's no canceling this operation.
The videos should now be near the top of your processing queue.
Navigate to a second page of filtered queue results, or to another channels queue.
Make sure the inspection window is still up, switch to that and press up to re-load the script, then execute it again.