Skip to content

fconidi/Yt2md-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yt2md-Converter YouTube to Markdown Converter

Convert YouTube video links to formatted Markdown code for GitHub README files


English | Italiano



yt2md-icon

English



Description

A comprehensive suite of tools to convert YouTube video links into formatted Markdown code, perfect for technical documentation, GitHub README files, and blogs.

Available in 4 versions:

  • Simple CLI
  • GUI with graphical interface (recommended)
  • Offline CLI with options
  • Advanced CLI

Installation

Requirements:

  • None for CLI versions
  • zenity and xclip for GUI version

Installation:

git clone https://github.com/fconidi/Yt2md-Converter
cd yt2md
bash yt2md.sh --help

Usage

Quick Start

bash yt2md.sh VIDEO_ID "TITLE" "AUTHOR"

Output:

[![TITLE](thumbnail)](url)

1. yt2md.sh - Simple CLI

bash yt2md.sh VIDEO_ID "TITLE" ["AUTHOR"]

Options:

-f FORMAT    Output format: standard|simple|table|embed
-s SIZE      Thumbnail quality: default|medium|high|maxres
-o FILE      Save to file
-h           Show help

Examples:

# Basic
bash yt2md.sh dQw4w9WgXcQ "Linux Tutorial"

# With author
bash yt2md.sh dQw4w9WgXcQ "Tutorial" "Channel Name"

# Table format
bash yt2md.sh -f table dQw4w9WgXcQ "Video" "Author"

# Save to file
bash yt2md.sh -o output.md VIDEO_ID "Title" "Author"

2. yt2md-gui.sh - Graphical Interface (Recommended)

bash yt2md-gui.sh

Features:

  • Step-by-step guided dialogs
  • Input validation
  • Multiple output formats
  • Clipboard integration
  • Batch conversion
  • Built-in help

Batch format:

VIDEO_ID | TITLE | AUTHOR

3. yt2md-offline.sh - Alternative CLI

bash yt2md-offline.sh -t "TITLE" -a "AUTHOR" VIDEO_ID

4. yt2md-cli.sh - Advanced CLI

bash yt2md-cli.sh --offline --title "TITLE" --author "AUTHOR" VIDEO_ID

Output Formats

Standard (Default):

[![Title](thumbnail)](url)

Simple:

[Title](url)

Table:

| Video | Author |
|-------|--------|
| [![Title](thumb)](url) | Author |

Embed:

<a href="url"><img src="thumb" alt="Title" width="480"></a>
<iframe width="560" height="315" src="embed_url"></iframe>

Extract Video ID

From YouTube URL:

https://www.youtube.com/watch?v=dQw4w9WgXcQ → dQw4w9WgXcQ
https://youtu.be/dQw4w9WgXcQ → dQw4w9WgXcQ
https://youtube.com/shorts/dQw4w9WgXcQ → dQw4w9WgXcQ

Automation

Bash Alias:

# Add to ~/.bashrc
alias ytm='bash /path/to/yt2md.sh'

Helper Script:

#!/bin/bash
VIDEO_ID="$1"
TITLE="$2"
AUTHOR="${3:-MyChannel}"
bash yt2md.sh "$VIDEO_ID" "$TITLE" "$AUTHOR" >> README.md

Batch Processing:

while IFS='|' read -r id title author; do
    bash yt2md.sh "$id" "$title" "$author"
done < videos.txt

Testing

bash test-all.sh

Troubleshooting

Script doesn't work:

# Always use: bash script.sh
bash yt2md.sh VIDEO_ID "TITLE"

GUI doesn't open:

# Install zenity
sudo apt install zenity

Empty output:

# Verify syntax - use quotes for titles with spaces
bash yt2md.sh VIDEO_ID "Title with spaces" "Author"

Documentation

File Description
README.md This file
test-all.sh Automated tests

License

MIT License - See LICENSE file for details

Author

Franco Conidi aka Edmond - Senior System Integrator, Network Engineer, IT Consultant, Blogger, Linux Developer https://francoconidi.it https://syslinuxos.com




Italiano




Descrizione

Suite completa di strumenti per convertire link di video YouTube in codice Markdown formattato, perfetto per documentazione tecnica, file README di GitHub e blog.

Disponibile in 4 versioni:

  • CLI semplice
  • GUI con interfaccia grafica (consigliato)
  • CLI offline con opzioni
  • CLI avanzato

Installazione

Requisiti:

  • Nessuno per le versioni CLI
  • zenity e xclip per la versione GUI

Installazione:

git clone https://github.com/fconidi/Yt2md-Converter
cd yt2md
bash yt2md.sh --help

Utilizzo

Avvio Rapido

bash yt2md.sh VIDEO_ID "TITOLO" "AUTORE"

Output:

[![TITOLO](thumbnail)](url)

1. yt2md.sh - CLI Semplice

bash yt2md.sh VIDEO_ID "TITOLO" ["AUTORE"]

Opzioni:

-f FORMAT    Formato output: standard|simple|table|embed
-s SIZE      Qualità thumbnail: default|medium|high|maxres
-o FILE      Salva su file
-h           Mostra aiuto

Esempi:

# Base
bash yt2md.sh dQw4w9WgXcQ "Tutorial Linux"

# Con autore
bash yt2md.sh dQw4w9WgXcQ "Tutorial" "Nome Canale"

# Formato tabella
bash yt2md.sh -f table dQw4w9WgXcQ "Video" "Autore"

# Salva su file
bash yt2md.sh -o output.md VIDEO_ID "Titolo" "Autore"

2. yt2md-gui.sh - Interfaccia Grafica (Consigliato)

bash yt2md-gui.sh

Funzionalità:

  • Dialog guidati passo-passo
  • Validazione input
  • Formati multipli
  • Integrazione clipboard
  • Conversione batch
  • Aiuto integrato

Formato batch:

VIDEO_ID | TITOLO | AUTORE

3. yt2md-offline.sh - CLI Alternativa

bash yt2md-offline.sh -t "TITOLO" -a "AUTORE" VIDEO_ID

4. yt2md-cli.sh - CLI Avanzato

bash yt2md-cli.sh --offline --title "TITOLO" --author "AUTORE" VIDEO_ID

Formati Output

Standard (Default):

[![Titolo](thumbnail)](url)

Simple:

[Titolo](url)

Table:

| Video | Autore |
|-------|--------|
| [![Titolo](thumb)](url) | Autore |

Embed:

<a href="url"><img src="thumb" alt="Titolo" width="480"></a>
<iframe width="560" height="315" src="embed_url"></iframe>

Estrarre Video ID

Da URL YouTube:

https://www.youtube.com/watch?v=dQw4w9WgXcQ → dQw4w9WgXcQ
https://youtu.be/dQw4w9WgXcQ → dQw4w9WgXcQ
https://youtube.com/shorts/dQw4w9WgXcQ → dQw4w9WgXcQ

Automazione

Alias Bash:

# Aggiungi a ~/.bashrc
alias ytm='bash /percorso/yt2md.sh'

Script Helper:

#!/bin/bash
VIDEO_ID="$1"
TITOLO="$2"
AUTORE="${3:-MioCanale}"
bash yt2md.sh "$VIDEO_ID" "$TITOLO" "$AUTORE" >> README.md

Elaborazione Batch:

while IFS='|' read -r id titolo autore; do
    bash yt2md.sh "$id" "$titolo" "$autore"
done < video.txt

Test

bash test-all.sh

Risoluzione Problemi

Lo script non funziona:

# Usa sempre: bash script.sh
bash yt2md.sh VIDEO_ID "TITOLO"

La GUI non si apre:

# Installa zenity
sudo apt install zenity

Output vuoto:

# Verifica sintassi - usa virgolette per titoli con spazi
bash yt2md.sh VIDEO_ID "Titolo con spazi" "Autore"

Documentazione

File Descrizione
README.md Questo file
test-all.sh Test automatici

Licenza

MIT License - Vedi file LICENSE per dettagli

Author

Franco Conidi aka Edmond - Senior System Integrator, Network Engineer, IT Consultant, Blogger, Linux Developer https://francoconidi.it https://syslinuxos.com


About

Convert YouTube video links to formatted Markdown code for GitHub README files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages