Joensw/Reddit-Shorts-Bot

publishat feature.

Closed this issue · 2 comments

In YouTube you can schedule videos to be uploaded at different times. Along with my other issue related to repeating the script multiple times, it would be cool if you could space the uploads apart using scheduling and be able to specify an amount of time between each video. You can read about how to implement it here. https://developers.google.com/youtube/v3/docs/videos#status.publishAt.
The way that I would implement it if I knew Python would be that the first upload is whatever the default the user chose is. For me that would be public. All subsequent repeats would be defaulted as private so that they could be scheduled. The fact that it has to be in ISO 8601 format may be a bit of an annoyance but it's not too hard to figure out. Let's say that the user has specified that they want their videos to be spaced apart by 30 minutes. You could add 1800000 milliseconds to the equivalent of getDate() (which grabs the number of milliseconds since January 1, 1970) from JavaScript in Python, if there is one. For each video you add another 1800000 milliseconds. Then convert that into ISO 8601 format somehow. Timezone might be an issue, unsure.

Interesting idea. I recommend you look into the Windows Task Scheduler. This is a sweet and short (3 minute) guide on how to setup tasks to be run automatically: https://www.youtube.com/watch?v=ic4lUiDTbVI. It would allow you to automatically run the program daily, and by setting up identical tasks at different points in the day even multiple times a day, essentially achieving what you've suggested here. It might sound a bit complicated but its really simple as long as you follow the video.

On a side note, when he is setting up a new action in the video, for the "Add arguments" field he specifies run.py, for this program it would be main.py, or main.py "title" if you want to specify a title. Similarly for the "Start in" field he uses the directory wherein his python script is sitting, for this program you have to specify the directory in which main.py is sitting.

If you have any questions feel free to ask.

Oh man thanks for the tutorial link, I don't know why I never tried searching YT for a tutorial to that program. I tried it multiple times before thinking of the publishing thing, but figuring it out by myself was useless. I will try the tutorial, thanks for all the help!