久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='y0pZ4'></small><noframes id='y0pZ4'>

      • <bdo id='y0pZ4'></bdo><ul id='y0pZ4'></ul>
      <i id='y0pZ4'><tr id='y0pZ4'><dt id='y0pZ4'><q id='y0pZ4'><span id='y0pZ4'><b id='y0pZ4'><form id='y0pZ4'><ins id='y0pZ4'></ins><ul id='y0pZ4'></ul><sub id='y0pZ4'></sub></form><legend id='y0pZ4'></legend><bdo id='y0pZ4'><pre id='y0pZ4'><center id='y0pZ4'></center></pre></bdo></b><th id='y0pZ4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='y0pZ4'><tfoot id='y0pZ4'></tfoot><dl id='y0pZ4'><fieldset id='y0pZ4'></fieldset></dl></div>

      1. <legend id='y0pZ4'><style id='y0pZ4'><dir id='y0pZ4'><q id='y0pZ4'></q></dir></style></legend>
      2. <tfoot id='y0pZ4'></tfoot>
      3. 是否可以使用 discord.py(從視頻中的給定時間戳播

        Is it possible to seek through streamed youtube audio with discord.py (play from a given timestamp in the video)?(是否可以使用 discord.py(從視頻中的給定時間戳播放)搜索流式 youtube 音頻?) - IT屋-程序員軟件開發技

      4. <legend id='zZ3JT'><style id='zZ3JT'><dir id='zZ3JT'><q id='zZ3JT'></q></dir></style></legend>

                  <tbody id='zZ3JT'></tbody>
                <i id='zZ3JT'><tr id='zZ3JT'><dt id='zZ3JT'><q id='zZ3JT'><span id='zZ3JT'><b id='zZ3JT'><form id='zZ3JT'><ins id='zZ3JT'></ins><ul id='zZ3JT'></ul><sub id='zZ3JT'></sub></form><legend id='zZ3JT'></legend><bdo id='zZ3JT'><pre id='zZ3JT'><center id='zZ3JT'></center></pre></bdo></b><th id='zZ3JT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zZ3JT'><tfoot id='zZ3JT'></tfoot><dl id='zZ3JT'><fieldset id='zZ3JT'></fieldset></dl></div>
                <tfoot id='zZ3JT'></tfoot>
                  <bdo id='zZ3JT'></bdo><ul id='zZ3JT'></ul>

                  <small id='zZ3JT'></small><noframes id='zZ3JT'>

                • 本文介紹了是否可以使用 discord.py(從視頻中的給定時間戳播放)搜索流式 youtube 音頻?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  不幸的是,傳入帶有 &t= 標記的 URL 不會導致 discord.pyVoiceClient 在該時間戳開始播放.我正在使用 youtube_dl.

                  Unfortunately passing in a URL with a &t= tag does not cause discord.py's VoiceClient to start playing at that timestamp. I'm using youtube_dl.

                  是否可以在 discord.py 中搜索音頻,以便從開頭以外的某個地方開始流式傳輸 YouTube 視頻?

                  Is is possible to seek through audio within discord.py in order to start streaming a YouTube video from somewhere besides the start?

                  我知道像 Groovy 之類的一些專業機器人具有用于流式 YouTube 視頻的搜索命令,因此 Discord API 本身能夠這個.

                  I know some professional bots like Groovy have seek commands for streamed YouTube videos, so the Discord API itself is capable of this.

                  我使用的代碼來自 這里.

                  推薦答案

                  ffmpeg_options 中,您可以使用 -ss 查找特定的時間戳標志.

                  In the ffmpeg_options, you're able to seek to a specific timestamp with the use of the -ss flag.

                  如果您希望從例如 40 秒開始,這就是選項的外觀:

                  This is just how the options should look if you wish to start from, for example, 40 seconds:

                  ffmpeg_options = {
                      'options': '-vn -ss 40'
                  }
                  

                  當然你可以在 stream 命令中添加一個可選變量:

                  And of course you can add an optional variable to the stream command:

                  import typing # for the optional argument of the timestamp
                  
                      @classmethod
                      async def from_url(cls, url, *, loop=None, stream=False, timestamp=0):
                          # moved the options from outside the class to inside the method.
                          # this allows the use of variables in the options
                          ffmpeg_options = {
                              'options': f'-vn -ss {timestamp}'
                          }
                          # rest of the from_url code
                  
                      @commands.command()
                      async def stream(self, ctx, timestamp: typing.Optional[int]=0, *, url): # add the arg
                          """Streams from a url (same as yt, but doesn't predownload)"""
                  
                          async with ctx.typing():
                              player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True, timestamp=timestamp)
                              # other code
                  

                  我只添加了我從音樂機器人示例編輯的代碼,所以我希望我編輯的內容很清楚.如果需要任何進一步的說明/某些東西是如何工作的,那么我很樂意進行編輯.

                  I only added in the code that I edited from the music bot example, so I hope it's clear what I edited. If any further clarification is needed/how something works, then I'll be happy to make edits.

                  參考資料:

                  • FFMPEG 文檔 - -ss 的 Ctrl + F.
                  • discord 命令中的可選參數
                  • f-strings - Python 3.6.0+
                  • FFMPEG Docs - Ctrl + F for -ss.
                  • Optional arguments in discord commands
                  • f-strings - Python 3.6.0+

                  這篇關于是否可以使用 discord.py(從視頻中的給定時間戳播放)搜索流式 youtube 音頻?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                    <bdo id='9Xxu3'></bdo><ul id='9Xxu3'></ul>
                    <tfoot id='9Xxu3'></tfoot>

                      <small id='9Xxu3'></small><noframes id='9Xxu3'>

                            <tbody id='9Xxu3'></tbody>

                          <i id='9Xxu3'><tr id='9Xxu3'><dt id='9Xxu3'><q id='9Xxu3'><span id='9Xxu3'><b id='9Xxu3'><form id='9Xxu3'><ins id='9Xxu3'></ins><ul id='9Xxu3'></ul><sub id='9Xxu3'></sub></form><legend id='9Xxu3'></legend><bdo id='9Xxu3'><pre id='9Xxu3'><center id='9Xxu3'></center></pre></bdo></b><th id='9Xxu3'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9Xxu3'><tfoot id='9Xxu3'></tfoot><dl id='9Xxu3'><fieldset id='9Xxu3'></fieldset></dl></div>

                        1. <legend id='9Xxu3'><style id='9Xxu3'><dir id='9Xxu3'><q id='9Xxu3'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 国产日韩欧美 | 人操人人 | 中文字幕免费在线 | 国产精品一区二区三区四区 | 国产羞羞视频在线观看 | 欧美一区二区三区在线观看 | 久久久久久久久国产成人免费 | 国产精品一区二区日韩 | 欧美一区二区三区在线观看 | 99国产精品久久久久老师 | 日韩色在线 | 国产精品中文字幕在线播放 | 欧美xxxx在线| 超碰在线人人干 | 伊人久久在线观看 | 91视频大全| 久久一区二区三区免费 | 91精品国产一区二区三区香蕉 | 欧美国产日韩一区二区三区 | 亚洲永久字幕 | 国产成人精品免费视频 | 日韩视频在线观看一区二区 | www.精品国产 | 亚洲精品一区二区三区丝袜 | 中文字幕视频在线观看 | 亚洲人成人网 | 日韩一区二区黄色片 | 欧美日韩国产三级 | 91精品在线播放 | 精品国产一区二区三区性色 | 中文字幕成人av | 成人精品在线观看 | 欧美一区二区在线视频 | 日本一区二区三区四区 | 国产精品久久久久久婷婷天堂 | 黄色一级在线播放 | 国产一区二区在线免费播放 | 麻豆久久 | 日韩精品一区二区三区视频播放 | 国产精品国产精品国产专区不卡 | 欧美激情第一区 |