Skip to main content

Python YouTube Concentric Circles Image

Project description

PYTCHI

Python YouTube Concentric Circles Image

You Huh?? No H in pytcci?

Me Are you serious?

Installation

pip3 install pytchi

Dependancies:

  • opencv-python-headless
  • pycairo
  • python-slugify
  • pytube

Usage

Following code produces:

  • two PNG images: first with concentric circles, second with lines from this video;
  • one PNG image (1000px width) with concentric circles from this video
  • one SVG file with concentric circles from this video using 1 image every 2 seconds and then cleans for it only remains the final image
  • 3 PNG images with concentric circles from this playlist using diagonal line extraction instead of random (default) and reversing images: innermost for first images. Note that URL has just to contain a list variable so that pytchi produces an image for each video of that playlist. Each image is 800x800 pixels.
import pytchi
import os


# 
o = pytchi.pytchi('https://www.youtube.com/watch?v=EelPrEojesM')
o.to_img() # export to png (concentric circles)
o.shape = 'lines'
o.to_img() # export to png (rectangle with lines)
#
p = pytchi.pytchi('https://www.youtube.com/watch?v=IjxkCokODEs')
p.to_img(1_000) # outputs a 1000px image
#
q = pytchi.pytchi('https://www.youtube.com/watch?v=PVyS9JwtFoQ')
q.step = 2 # every 2 seconds of the video (default is 1)
q.to_svg() # export to svg
q.clean(all) # deletes temporary files so that p object is unsable now!
#
# playlist: treat several videos
r = pytchi.pytchi('https://www.youtube.com/watch?v=gxAaO2rsdIs&list=PLZHQObOWTQDOcxqQ36Vow3TdTRjkdSvT-')
r.xmth = 'diagonal' # change extraction method
r.reverse = True # reverse order of inserted images
r.to_img(800)

Outputs

Copyright

2021 / D. COBAC / CC-BY-NC-SA

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytchi-0.2.tar.gz (9.1 kB view hashes)

Uploaded Source

Built Distribution

pytchi-0.2-py3-none-any.whl (17.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page