Add videos by python Geanki

Good evening, does anyone have any suggestions or know how I could add videos via the geanki library in Python? I tried to create using the code below but the video does not appear. I’ve already tried using just {{PathVideo}}, the video loads with the MPV but the video has to be in the indicated path, I wanted the video to be already inside this file when exporting the .apkg file to send to other people.

 # Crie um modelo de carta
    modelo_carta = genanki.Model(
        'Modelo de Carta Simples',
            {'name': 'Frente'},
            {'name': 'Verso'},
            {'name': 'video'}
                'name': 'Carta Padrão',
                'qfmt': '<video controls><source src="{{video}}" type="video/mp4"></video><br>{{Frente}}<br>',
                'afmt': '<div style="text-align: center;">{{FrontSide}}<hr id="answer">{{Verso}}</div>',

    # Crie um deck
    deck = genanki.Deck(
        'A meu Deck Anki')

    # Crie uma carta
    carta = genanki.Note(
        fields=['The book is on the table', 'O livro está na mesa', "videos/cut_10_17.87_to_22.559.mp4"])

    # Adicione a carta ao deck

    # Exporte o deck para um arquivo .apkg
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.