
Recherche avancée
Autres articles (30)
-
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras. -
Possibilité de déploiement en ferme
12 avril 2011, parMediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...) -
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...)
Sur d’autres sites (6266)
-
Revision 16221 : Report de [16219] en 2.2. Ca, par exemple : la fonction d’analyse de ...
20 septembre 2010, par esj@… — LogReport de [16219] en 2.2. Ca, par exemple : la fonction d’analyse de fichier de connexion ne reconnaisait pas un fichier en version 0.4
-
How to Download YouTube Videos in 1080p with English Subtitles Using yt-dlp with Python 3
30 juillet 2024, par edge selcukI am trying to download YouTube videos using
yt-dlp
in Python 3.9. I want to download videos in 1080p quality and if 1080p is not available, it should download the best available quality. The audio and video files should be merged into a single MP4 file, and I haveffmpeg
installed to handle the merging process.

Here is my script :


import os
import sys
from yt_dlp import YoutubeDL

def download_video(url):
 output_dir = r"/path" # Update this path

 # Ensure the output directory exists
 if not os.path.exists(output_dir):
 os.makedirs(output_dir)
 
 ydl_opts = {
 'format': '(bestvideo[height<=1080][ext=mp4]/bestvideo)+bestaudio/best',
 'merge_output_format': 'mp4',
 'write_auto_sub': True,
 'writesubtitles': True,
 'subtitleslangs': ['en'],
 'subtitlesformat': 'vtt',
 'embedsubtitles': True,
 'outtmpl': os.path.join(output_dir, '%(title)s.%(ext)s'),
 'postprocessors': [{
 'key': 'FFmpegVideoConvertor',
 'preferedformat': 'mp4',
 }],
 }

 with YoutubeDL(ydl_opts) as ydl:
 ydl.download([url])

if __name__ == "__main__":
 if len(sys.argv) != 2:
 print("Usage: python download_video.py ")
 sys.exit(1)

 youtube_url = sys.argv[1]
 download_video(youtube_url)



This script successfully downloads the video in 1080p quality or the best available quality and merges the audio and video files as intended. However, it does not download the subtitles as intended.


I have
ffmpeg
installed for merging the video and audio files. How can I modify this script to ensure that English subtitles are downloaded and embedded in the video file ?

-
Revision 16219 : Ca, par exemple : la fonction d’analyse de fichier de connexion ne ...
20 septembre 2010, par esj@… — LogCa, par exemple : la fonction d’analyse de fichier de connexion ne reconnaisait pas un fichier en version 0.4