Skip to content

Instantly share code, notes, and snippets.

View Mukhopadhyay's full-sized avatar
🌏
Staying alive!!

Pranesh Mukhopadhyay Mukhopadhyay

🌏
Staying alive!!
View GitHub Profile
@Mukhopadhyay
Mukhopadhyay / youtube-channel-details.py
Last active January 29, 2022 22:43
Youtube channel details & available videoes using selenium (Chrome).
import sys
import numpy as np
import pandas as pd
from typing import Optional
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import NoSuchElementException
chrome_options = Options()
chrome_options.add_argument('--headless')
@Mukhopadhyay
Mukhopadhyay / youtube-thumbnail-download.py
Last active January 30, 2022 18:40
Method for downloading YouTube video thumbnails
import requests
from typing import Optional
def download_youtube_thumbnail(video_id: str, filename: Optional[str] = 'image.jpg') -> None:
"""
Method for downloading youtube thumbnail (if explicitly set by the
publisher) in maximum resolution. If filename is not passed then the
image will be saved as 'image.jpg'.
Args:
@Mukhopadhyay
Mukhopadhyay / deprecated_decorator.py
Last active July 12, 2022 16:27
Deprecation warning decorator in python!
import warnings
import functools
def deprecated(function):
"""
This decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used.
Args:
function: function: Function to be overridden!