How to get .mpd file for a youtube video

青春壹個敷衍的年華 提交于 2019-12-23 02:34:41

问题


I am trying to use DASH using ExoPlayer in android,

I need to get url for mpd file.

Can I get URL for .mpd file for any YouTube video?

How to find URL .mpd file for a particular YouTube video ?


回答1:


As I commented out, you could use the python library extract-youtube-mpd for that. But it requires python and Linux.

Through it's code, I've found these are the steps it follows plus extra ones if you like to create your own automation/extension:

1) Right click in page and select to show page's source code

2) search the HTML file (the one that will be shown) for "dashmpd"

3) extract the text within quotes, as in (e.g.): "dashmpd":"https://manifest.googlevideo.com/api/manifest/dash/ ... "_

4) replace "/" for "/" if needed (i.e. if not using regex). This will give you a source for a XML file

5) parse the XML, through periods, adaptation sets and representation settings (this is when it gets complicated)

Since I'm also in the need for this, I'll probably release a node module for this.. Will update here



来源:https://stackoverflow.com/questions/43843237/how-to-get-mpd-file-for-a-youtube-video

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!