Skip to content

Instantly share code, notes, and snippets.

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@ajitid
ajitid / Modal.tsx
Created January 31, 2020 12:38
React Modal
import React, { useRef, useEffect } from 'react'
export enum ModalCloseReason {
ClickedCloseButton,
PressedKeyboardEscape,
ClickedOutside,
TouchedOutside,
OtherEvent,
}
@ajitid
ajitid / README.md
Last active September 18, 2020 19:40
Scrollable content
@ajitid
ajitid / README.md
Last active March 30, 2022 20:41
Restores scroll in React app

Uses a feature of React Router v6 internally to have more flexibility over naming of the keys.

Needs two params:

  • A key to uniquely identify the list in the page
  • A reference to list's HTML element

Inspired by a hook used in Remix. (Watch this video)

@ajitid
ajitid / AliveAbleRoutes.tsx
Last active January 12, 2023 15:36
Keep alive routes
import React, { ReactElement, useState, useLayoutEffect } from 'react';
import { Routes, Route } from 'react-router-dom';
import type { RoutesProps, RouteProps } from 'react-router';
const AliveAbleRoutes = ({ children, ...props }: RoutesProps) => {
const routes = React.Children.toArray(children);
const keepAliveRoutes = routes.filter((route) => {
if (!React.isValidElement(route)) return false;
return route.type === KeepAliveRoute;
@ajitid
ajitid / config.fish
Created October 17, 2020 12:38
fish config
export PATH="$PATH:/home/frefko/Downloads/platform-tools"
export PATH="/mnt/Media/proj/installed/jdk1.8.0_144/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
pyenv init - | source
type ValueType<
S extends string,
R extends Record<string, any>
> = S extends `${infer T}.${infer U}` ? ValueType<U, R[T]> : R[S];
export type Dotted<
S extends string,
R extends Record<string, any>
> = ValueType<S, R> extends infer A
? unknown extends A
{
"React useState": {
"scope": "javascript,typescript,typescriptreact",
"prefix": "rus",
"body": "const [${1}, set${1/(.*)/${1:/capitalize}/}] = useState(${3})",
"description": "Create a React useState hook"
},
"React import": {
"scope": "javascript,typescript,typescriptreact",
"prefix": "imr",
@ajitid
ajitid / .wslconfig
Last active April 28, 2025 07:29
Run GUI applications in WSL1
# C:/Users/zlksnk/.wslconfig
# [wsl2]
# kernel=<path> # An absolute Windows path to a custom Linux kernel.
# memory=<size> # How much memory to assign to the WSL2 VM.
# processors=<number> # How many processors to assign to the WSL2 VM.
# swap=<size> # How much swap space to add to the WSL2 VM. 0 for no swap file.
# swapFile=<path> # An absolute Windows path to the swap vhd.
# localhostForwarding=<bool> # Boolean specifying if ports bound to wildcard or localhost in the WSL2 VM should be connectable from the host via localhost:port (default true).