Schakel gif functie uit
Voor "onderhoud", maar dat zal wel een paar jaartjes op de backlog blijven staan.
This commit is contained in:
+9
-30
@@ -106,41 +106,20 @@ class General(commands.Cog):
|
|||||||
@commands.command(pass_context=True)
|
@commands.command(pass_context=True)
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def gif(self, ctx, yt: str, start: str="0", duration: str="5", res: str="320", fps: int=10):
|
def gif(self, ctx, yt: str, start: str="0", duration: str="5", res: str="320", fps: int=10):
|
||||||
""" Giffify.
|
""" Giffify. Tijdelijk uitgeschakeld.
|
||||||
Syntax: !gif [YT] [START] [DUUR] [RESOLUTIE] [FPS]
|
|
||||||
Bv: !gif RPxvTd_jCPQ 10 5 320 10
|
|
||||||
Alleen de Youtube ID is nodig.
|
|
||||||
Start en duur zijn in seconden.
|
|
||||||
Resolutie is de breedte
|
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
yield from ctx.message.delete()
|
yield from ctx.message.delete()
|
||||||
except:
|
except:
|
||||||
print("No permission to delete message")
|
print("No permission to delete message")
|
||||||
try:
|
yield from ctx.channel.send(
|
||||||
os.remove('temp')
|
ctx.author.mention +
|
||||||
except:
|
"""
|
||||||
pass
|
Welkom bij de stroopwafel GIF hotline!
|
||||||
ydl_opts = {
|
Deze functionaliteit is momenteel helaas offline voor onderhoud. Gelukkig is vergelijkbare functionaliteit ook elders beschikbaar:
|
||||||
'outtmpl': 'temp',
|
Op <https://gifrun.com/> kunt u bijvoorbeeld via een web-interface gifjes maken van youtube-filmpjes. Geavanceerde gebruikers kunnen u ook <https://youtube-dl.org/> proberen, waarna u gifjes kan genereren via bijvoorbeeld <https://ezgif.com/>.
|
||||||
'format': 'bestvideo[ext=mp4]/mp4'
|
|
||||||
}
|
Namens de directie van Stroopwafel B.V. onze excuses voor dit ongemak.""")
|
||||||
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
|
||||||
ydl.download([yt])
|
|
||||||
split = ffmpeg.input('temp').trim(start=start, duration=duration).filter_('fps',fps=fps).filter_('scale', w=res, h=-1).filter_multi_output('split')
|
|
||||||
pal = split.stream(0).filter_('palettegen')
|
|
||||||
inputs = {
|
|
||||||
'v1':split.stream(1),
|
|
||||||
'v2':pal
|
|
||||||
}
|
|
||||||
gif = (
|
|
||||||
ffmpeg
|
|
||||||
.filter(stream_spec=[split.stream(1), pal], filter_name='paletteuse')
|
|
||||||
.output('out.gif')
|
|
||||||
.overwrite_output()
|
|
||||||
.run()
|
|
||||||
)
|
|
||||||
yield from ctx.channel.send(ctx.author.mention + ' hoi ', file=discord.File('out.gif'))
|
|
||||||
|
|
||||||
@commands.command(pass_context=True)
|
@commands.command(pass_context=True)
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
|||||||
Reference in New Issue
Block a user