Skip to content
This repository has been archived by the owner on Jul 26, 2020. It is now read-only.

Video Import Script #3

Closed
dirkkelly opened this issue Jan 22, 2019 · 5 comments · Fixed by #15
Closed

Video Import Script #3

dirkkelly opened this issue Jan 22, 2019 · 5 comments · Fixed by #15
Assignees
Labels
enhancement New feature or request xp/developer Aims to improve the experience for BreadTube developers

Comments

@dirkkelly
Copy link
Member

dirkkelly commented Jan 22, 2019

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

id: VIDEO_ID
title: VIDEO_TITLE.split(" | ").first
channel: CHANNELSLUG
series: VIDEO_TITLE.split(" | ").last
description: VIDEO_DESCRIPTION.paragraphs.first
source: youtube
@JadePrice
Copy link

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

@dirkkelly
Copy link
Member Author

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.

@jamesmeneghello
Copy link
Member

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.

@JadePrice
Copy link

@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.
Thanks for taking a look!

@dirkkelly
Copy link
Member Author

Video Import Script

@jmickey jmickey transferred this issue from breadtubetv/breadtubetv Apr 18, 2019
@dirkkelly dirkkelly added enhancement New feature or request xp/developer Aims to improve the experience for BreadTube developers labels Apr 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request xp/developer Aims to improve the experience for BreadTube developers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants