
Recherche avancée
Autres articles (86)
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
Sur d’autres sites (8058)
-
Youtube-dl and Ffmpeg
25 juin 2022, par Joksyi have made a music bot with discord.py, but i get this info thing and it doesnt work anymore
error [youtube] QxYdBvB8sOY: Downloading webpage 985104597242773505 [2022-06-25 07:45:51] [INFO ] discord.player: Preparing to terminate ffmpeg process 37580. [2022-06-25 07:45:51] [INFO ] discord.player: ffmpeg process 37580 has not terminated. Waiting to terminate... [2022-06-25 07:45:51] [INFO ] discord.player: ffmpeg process 37580 should have terminated with a return code of 1.
this is my code

import discord
import os
import asyncio
import youtube_dl
from discord import *

token = "token is here"
prefix = "j!"
blocked_words = ["blocked words are here"]

voice_clients = {}

yt_dl_opts = {'format': 'bestaudio/best'}
ytdl = youtube_dl.YoutubeDL(yt_dl_opts)

ffmpeg_options = {'options': "-vn"}

intents = discord.Intents.default()
intents.message_content = True

client = discord.Client(intents=intents)


programmer_role = "987018590152699964"
 


@client.event
async def on_ready():
 print(f"Bot logged in as {client.user}")

@client.event
async def on_message(msg):
 if msg.author != client.user:
 if msg.content.lower().startswith(f"{prefix}info"):
 await msg.channel.send(f"Hi, Im JoksysBot Made By Joksy!")

 for text in blocked_words:
 if text in str(msg.content.lower()):
 await msg.delete()
 await msg.channel.send("Hey, Dont Say That!")
 return
 if msg.content.startswith(f"{prefix}play"):

 try:
 voice_client = await msg.author.voice.channel.connect()
 voice_clients[voice_client.guild.id] = voice_client
 except:
 print("error")

 try:
 url = msg.content.split()[1]

 loop = asyncio.get_event_loop()
 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=False))

 song = data['url']
 player = discord.FFmpegPCMAudio(song, **ffmpeg_options, executable="C:\\Users\\jonas\\Documents\\ffmpeg-2022-06-16-git-5242ede48d-full_build\\ffmpeg-2022-06-16-git-5242ede48d-full_build\\bin\\ffmpeg.exe")

 voice_clients[msg.guild.id].play(player)

 except Exception as err:
 print(err)

 if msg.content.startswith(f"{prefix}pause"):
 try:
 voice_clients[msg.guild.id].pause()
 except Exception as err:
 print(err)

 if msg.content.startswith(f"{prefix}resume"):
 try:
 voice_clients[msg.guild.id].resume()
 except Exception as err:
 print(err)

 if msg.content.startswith(f"{prefix}stop"):
 try:
 voice_clients[msg.guild.id].stop()
 await voice_clients[msg.guild.id].disconnect()
 except Exception as err:
 print(err)

client.run(token)




its weird since all the other code in my bot works fine like the
!info
command, so it must be an error with either youtube-dl or ffmpeg. But then again it doesnt join the voice call in the first place so that might be the error. i added ffmpeg to path but i still wrote the path to it hereplayer = discord.FFmpegPCMAudio(song, **ffmpeg_options, executable="C:\\Users\\jonas\\Documents\\ffmpeg-2022-06-16-git-5242ede48d-full_build\\ffmpeg-2022-06-16-git-5242ede48d-full_build\\bin\\ffmpeg.exe")
. i followed this tutorial for the bot https://www.youtube.com/watch?v=Q8wxin72h50&t=1040s i did everything he did but it didnt work. My discord.py version is2.0.0
my Python version is3.10.5
and my youtube_dl version is2021.12.17
my ffmpeg download isffmpeg-2022-06-16-git-5242ede48d-full_build
. I tested it ondiscord.py 1.73
and it worked fine. This was in intellij though whilst my main program is in Visual Studio Code but i couldnt see it making any big difference so it could be the intents that makes the program not work.I couldnt see any mistakes in the code but im new to discord.py, youtube_dl and ffmpeg stuff so unless visual studio code showed me what i did wrong, i wouldnt notice. But what did i do wrong and how can i fix it ?

-
YouTube-DL Python output file format not mp4
16 septembre 2020, par SushilI have written a small piece of code in python to extract either the audio or the video from a YouTube video. Here is the code :


from __future__ import unicode_literals
import youtube_dl

link = input("Enter the video link:")

while True:
 choice = input("Enter a for audio file, v for video file:")
 if choice == "a" or choice == "v":
 break

ydl_opts = {}

if choice == "a":
 ydl_opts = {
 'format': 'bestaudio/best',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }],
 }
 
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 info_dict = ydl.extract_info(link, download=False)
 video_title = info_dict.get('title', None)

if choice == "a":
 path = f'D:\\DwnldsYT\\{video_title}.mp3'
if choice == "v":
 path = f'D:\\DwnldsYT\\{video_title}.mp4'

ydl_opts.update({'outtmpl':path})

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



The audio extraction works fine, but the problem is with the video extraction. When I extract the video, I am getting the output as an mkv file, not an mp4 file. Any idea about how to save the video file as mp4 ?


-
YouTube fixed is player problem with old IE, so changing examples back over to the HTML5 player, rather than AS3.
12 juillet 2013, par jackmooreYouTube fixed is player problem with old IE, so changing examples back over to the HTML5 player, rather than AS3. Used latest jQuery lib