Hirdetés

Keresés

Új hozzászólás Aktív témák

  • Hege1234

    addikt

    válasz gojko.m #8862 üzenetére

    szívesen

    pythonnal igen,

    import yt_dlp

    ydl_opts = {
    'outtmpl': '%(title)s',
    'writeinfojson': False
    }

    url = input('\nlink: ')

    with yt_dlp.YoutubeDL(ydl_opts) as ydl:
    info_dict = ydl.extract_info(url, download=False)

    filename = ydl.prepare_filename(info_dict)
    chapters = info_dict.get('chapters', [])

    import datetime

    def convert_to_time_format(seconds):
    time = str(datetime.timedelta(seconds=seconds))
    milliseconds = str(int((seconds % 1) * 1000)).zfill(3)
    time_with_ms = f"{time}.{milliseconds}"
    return time_with_ms

    with open('fejezetek' + ' - ' + filename + '.txt', 'w') as f:
    for chapter in chapters:
    start_time = convert_to_time_format(chapter['start_time'])
    f.write(start_time +' '+chapter['title'] + '\n')

    fejezetek - Tableau for Data Science....txt
    0:00:00.000 Intro
    0:02:21.000 What is Tableau
    0:03:34.000 Tableau Desktop Interface
    0:04:54.000 Download Tableau Public
    0:13:22.000 Labels
    0:16:17.000 Legend
    0:19:47.000 Pie Charts
    0:21:02.000 Create your own measure
    0:24:27.000 Move sections
    0:25:17.000 Changing colors

    de a komment szekcióból ezeket kibányászni
    az nem olyan egyszerű..

    tudsz amúgy olyan linket ahol egy kommentben vannak benne az időbélyegek?

Új hozzászólás Aktív témák