-
Notifications
You must be signed in to change notification settings - Fork 0
Video Import Script #3
Comments
I'm an amateur at Python scripts, but thought I'd give this a shot. It is definitely poorly coded, but I got it to work on my Mac in PyCharm. I'm having issues on PC (having an decoding error with the yml) and trying to get it to an exe to be used with arguments with Pyinstaller (the request module is missing). I'll keep working on that, but anyone else is free to take a look. Currently, it takes a video ID input from Python, collects all the lines from data/videos.yml and sections them off by video. Uses the requests module to get data from each Youtube page and gets the view count for every video in videos.yml. Then requests gets the html from the new video page and sorts out the Title, Channel, Description, Series, and View Count. This part is rough since it's just a bunch of lines trying to parse the html for the relevant information. I then add the views to each video (each video is a list within a bigger list so this makes it a video list of 8). Then it sorts the videos by view count, removes that from the final data, and writes all the videos back to videos.yml in the original format, sorted by view count, and with the new video included where it belongs. It's sort of a mess, but I'm glad I got it working within Python. Now just to get that working on PC (does anybody know what this decoding error with the yml might be?) and into an exe with an argument. https://github.com/HarrisonPrice/Python_Scripts/blob/master/Breadtube_ImportVideo_Draft.py |
Thanks @harrisonprice. @Murodese this is relevant to the work you're doing on this. Depending on the time it's going to take us to get a Go development environment setup and the relevant executables, this could help in the immediate needs. |
I'm spending a bit of time to properly architecture and framework the main cli executable so it's fairly extensible, so it'll take me a few days. Definitely something that can be used in the meantime, though, so thanks @harrisonprice! If you want me to take a look at what's wrong with the yaml parsing I can, I'll see if I can get to it tomorrow. |
@Murodese Yeah that would be great! It sounds like you guys have something much more professional planned. I thought it might be good practice for a basic script, but even better if it can be helpful for now. I'll keep trying to fix my script in the meantime. Looking forward to seeing what you come up with and how this project develops. |
Story
Given I am a Developer
And I want to import a new video
When I execute
bake video import CHANNELSLUG youtube VIDEOID
Then the video metadata* is added to
data/videos/CHANNELSLUG/VIDEOID.yml
Video MetaData
The text was updated successfully, but these errors were encountered: