Tôi muốn truy cập vào kết quả của lệnh shell:Làm thế nào để sử dụng youtube-dl từ một chương trình python
youtube-dl -g "www.youtube.com..."
để in sản lượng của nó direct url
nộp; từ bên trong chương trình python:
import youtube-dl
fromurl="www.youtube.com ...."
geturl=youtube-dl.magiclyextracturlfromurl(fromurl)
Có thể không? Tôi cố gắng để hiểu được cơ chế trong nguồn nhưng đã mất: youtube_dl/__init__.py
, youtube_dl/youtube_DL.py
, info_extractors
...
http://stackoverflow.com/questions/89228/calling-an-external-command-in-python –
Decent ghi-up ở đây: http: // willdrevo .com/download-youtube-and-soundcloud-audio-với-python-and-pandas/ – lollercoaster