2

当我将电影上传到 youtube 然后从给定的链接下载它时,它是同一部电影,但文件片段被改变了......有没有办法撤消 youtube 编码,所以我上传的文件和我下载的文件将是100%一样??

我正在使用 python pytube 下载

谢谢

from pytube import YouTube
import defines
# not necessary, just for demo purposes.
from pprint import pprint

yt = YouTube(defines.url)

# Once set, you can see all the codec and quality options YouTube has made
# available for the perticular video by printing videos.

pprint(yt.get_videos())

# [<Video: MPEG-4 Visual (.3gp) - 144p>,
#  <Video: MPEG-4 Visual (.3gp) - 240p>,
#  <Video: Sorenson H.263 (.flv) - 240p>,
#  <Video: H.264 (.flv) - 360p>,
#  <Video: H.264 (.flv) - 480p>,
#  <Video: H.264 (.mp4) - 360p>,
#  <Video: H.264 (.mp4) - 720p>,
#  <Video: VP8 (.webm) - 360p>,
#  <Video: VP8 (.webm) - 480p>]

# The filename is automatically generated based on the video title.  You
# can override this by manually setting the filename.

# view the auto generated filename:
print(yt.filename)
# Pulp Fiction - Dancing Scene [HD]

# set the filename:
# yt.set_filename('Dancing Scene from Pulp Fiction')

# You can also filter the criteria by filetype.
pprint(yt.filter('flv'))


print(yt.filter('mp4')[-1])
# <Video: H.264 (.mp4) - 720p>

# You can also get all videos for a given resolution
pprint(yt.filter(resolution='480p'))

# [<Video: H.264 (.flv) - 480p>,
# <Video: VP8 (.webm) - 480p>]



video = yt.get('3gp', '240p')

# NOTE: get() can only be used if and only if one object matches your         criteria.
# for example:

pprint(yt.videos)  

video = yt.get('webm')
video.download('here1.webm')
4

1 回答 1

0

Youtube 正在对视频进行编码以节省带宽并最大程度地减少不必要的网络流量。这些文件在 youtube 服务器上进行编码,原始文件很可能在此过程中被删除。

另外,你为什么还要这样做?您可以通过各种其他服务或协议(如 ftp 或 Dropbox 等)传输/共享文件(如果那是您所追求的)。

于 2016-01-28T15:40:21.257 回答