Sunday, July 14, 2019

Python Library to download all youtube videos and save it as Excel File or JSON

Untitled2

Python Library for Developers

In [1]:
%%html
<img src="https://media.licdn.com/dms/image/C4D12AQE_Eqoe5HrGBw/article-cover_image-shrink_600_2000/0?e=1568851200&v=beta&t=GyKOhffdm823yivUVk41YJu5NokgxmBLpXyNMSQ-pVo" , width=600, height=300>

Hello, In this Blog I want to Share a library developed for community introducing ytdvideo

Its hard when you have to use Google API we have to understand the Doccumenation and then come up with a logic for your code. I have Made a smart library in Python which can be downloaded using pip command

This Library allows Developers to Get all Youtube Videos Title and URL from any channel. think about if you have to do this manually go to each video and copy the link and save it to Excel File. I have added simple commands that allows user to save the entire data as Excel File and supports even JSON

In [2]:
%%html
<img src="https://media.licdn.com/dms/image/C4D12AQEGoCMgLeA5pA/article-inline_image-shrink_1500_2232/0?e=1568851200&v=beta&t=oTrCqceHPjQ1bipG0kwdSjDBQ_bTU4OZvT-7uK5QzwY" , width=600, height=300>

Look at this it created a Excel File with all 500 Videos from my channel

How to use

In [ ]:
# YoutubeVideo
This is a python Package which can download all youtube videos and save it as Excel File
and also Json File. It allows user to get all Titles, Youtube URL and Images from their channel

special Thanks to indianpythonist


more information visit : https://github.com/soumilshah1995/YoutubeVideo

# Import Library
from ytdvideo import YoutubeVideo

# Create a object and provide API key
obj = YoutubeVideo(api_key="YOUR KEY", channel_id="UC_eOodxvwS_H7x2uLQa")

# get the data
print(obj.get_title)


# Get all Title Return List
print(obj.get_title)

# Iterate over the Title
for title in obj.get_title:
    print(title)

# Get all Link Return List
print(obj.get_video_url)

# Iterate over the Link
for url in obj.get_video_url:
    print(url)


# Get all Images Return List
print(obj.get_image)

# Iterate over the Link
for img in obj.get_image:
    print(img)

# Get all Data return Tuple
print(obj.get_all)

# Iterate over the Link
for data in obj.get_all:
    print(data)

# save as Excel File
obj.save_excel

# save as JSON
obj.save_json

All you need is a API Key which can be Generated by going to google developer console

Have Question leave it in comments below

My Website: http://soumilshah.herokuapp.com

My Github: https://github.com/soumilshah1995

My Blog: https://soumilshah1995.blogspot.com

Linkedin: https://www.linkedin.com/in/shah-soumil/

Skype: Soumil.shah7

1 comment:

  1. I truly value this superb post that you have accommodated us. I guarantee this would be helpful for a large portion of the general population. convert youtube to mp3

    ReplyDelete

Develop Full Text Search (Semantics Search) with Postgres (PGVector) and Python Hands on Lab

final-notebook Develop Full Text Search (Semantics Search) with Postgres (PGVector)...