File size: 2,172 Bytes
d55322d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
497bf08
d55322d
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# pylint: disable=missing-module-docstring

import os

# List of approved YouTube channels from Terms of Use
APPROVED_CHANNELS = [
    # Academic Institutions
    "MIT OpenCourseWare", "stanford online", "harvard", "YaleCourses",
    
    # Educational Platforms
    "Khan Academy", "Coursera", "edx", "udacity",
    
    # Educational Content Creators
    "crashcourse", "TED-Ed", "TED", "TEDx Talks", "3blue1brown", "numberphile",
    "Computerphile", "SciShow", "veritasium", "minutephysics",
    "programmingwithmosh", "freecodecamp.org"
]

APPROVED_CHANNEL_IDS = {
    "MIT OpenCourseWare"    : "UCEBb1b_L6zDS3xTUrIALZOw",
    "stanford online"       : "UCBa5G_ESCn8Yd4vw5U-gIcg",
    "Stanford Online"       : "UCBa5G_ESCn8Yd4vw5U-gIcg",
    "harvard"               : "UCiR_s0m_o_6x4Qv9F9Kj_1A",
    "Harvard"               : "UCiR_s0m_o_6x4Qv9F9Kj_1A",
    "YaleCourses"           : "UC-Lg4S121Qk2pPqB09yD3Xg",
    "Khan Academy"          : "UC4a-Gbdw7KEp5o7L5d_22wQ",
    "Coursera"              : "UCF0m58Cj3iC_qD1L7I2d26Q",
    "edx"                   : "UCLx1L9tN206S8_61xW_B2qA",
    "udacity"               : "UClC7-L9_h7qT9B02D0HhBKA",
    "crashcourse"           : "UCX6b17PVsYBQ0ip5gyeme-Q",
    "TED-Ed"                : "UC_y-x5QvP93pBqD41zE3e3A",
    "TED"                   : "UCAuUUnT6oFdlLEx-H-v7Y0A",
    "TEDx Talks"            : "UCsooa4yRKGN_zEE8iknghZA",
    "3blue1brown"           : "UCYO_jab_esuFRV4b17AJtAw",
    "numberphile"           : "UCsT0gAGB4I5rR_n_tM8Qz-A",
    "Computerphile"         : "UC9-y-6csu5WGm29I7JiwpnA",
    "SciShow"               : "UCZYTClx2T1of7BRZ86-8fow",
    "veritasium"            : "UCHnyfMqiRRG1u-2MsSQLbXA",
    "minutephysics"         : "UCUHW94eEFW7hkUMVaZz4eDg",
    "programmingwithmosh"   : "UCWv7g_L_jL4L_gT43hS-x2A",
    "freecodecamp.org"      : "UC8butISFwT-Wl7EV0hUK0BQ"
}

HF_SPACE_ID = os.getenv("HF_SPACE_ID", "Jing997/chaptive")
HF_SPACE_BRANCH = os.getenv("HF_SPACE_BRANCH", "main")
HF_ASSET_BASE_URL = os.getenv(
    "HF_ASSET_BASE_URL",
    f"https://huggingface.co/spaces/{HF_SPACE_ID}/resolve/{HF_SPACE_BRANCH}",
)
HF_IMG_BASE_URL = os.getenv("HF_IMG_BASE_URL", f"{HF_ASSET_BASE_URL}/img")