Nhờ thím test thử kiểu play bằng link twitter chứ không phải extract m3u8.Bình thường mà bác, load rất nhanh https://streamable.com/phzh62
Chỗ ngày giờ ấy thím?
Nhờ thím test thử kiểu play bằng link twitter chứ không phải extract m3u8.Bình thường mà bác, load rất nhanh https://streamable.com/phzh62
Làm gì xem được đâu bác? mà làm gì phải khổ thế? Cái gì nhanh, nét thì mình dùng thôi chứ?Nhờ thím test thử kiểu play bằng link twitter chứ không phải extract m3u8.
Chỗ ngày giờ ấy thím?
Nhanh thì dùng cách này chứ thím,Làm gì xem được đâu bác? mà làm gì phải khổ thế? Cái gì nhanh, nét thì mình dùng thôi chứ?
mpv https://twitter.com/TheBabylonBee/status/1664014211956236288
trích cookies ra thôicó cách nào để khi cài lại win ko phải đn lại tất cả các trang ko các bác nhỉ
Cái này thì nhờ bác @toi la gay :sosad: , chứ em không play nổi luônNhanh thì dùng cách này chứ thím,
Code:mpv https://twitter.com/TheBabylonBee/status/1664014211956236288
Đỡ phải thông qua m3u8, hiện tại script nó dectect 1 video mà chục link loạn luôn nên mình play link chính luôn.
Mình ghi thêm vào bài này rồi: Cách dùng MPV+Streamlink để xem livestream như Twitch, Youtube, Facebook...Đúng là chạy 1 mình thì nhanh hơn hẳn. Vậy chắc thím phải note lại rõ ràng để mắc công những người khác cứ tưởng sửa y chang file conf mà không chép đè file twitch.py thì cũng không chạy được
Mà em thấy tốt nhất là nếu xài streamlink thì cứ thêm cái bước Twitchttvlol bằng cách copy twitch.py vào luôn cho chắc vì ngta xem stream chắc cũng không muốn thấy quảng cáo hoặc stream bị đơ khi xài thằng Disableads
Ngoài ra để streamlink sử dụng TwitchTTVLOL để bỏ quảng cáo bằng cách giả làm Quang Linh Châu Phi thì làm theo bài: Cách bỏ qua quảng cáo khi xem Twitch với Streamlink+MPV tốt hơn (và bỏ twitch-disable-ads đi cho hai cái khỏi oánh nhau và TwitchTTVLOL sẽ làm việc tốt hơn, nhanh hơn. Test thực nghiệm: TwitchTTVLOL+DisableAds vs Chỉ TwitchTTVLOL)
Nhanh thì dùng cách này chứ thím,
Code:mpv https://twitter.com/TheBabylonBee/status/1664014211956236288
Đỡ phải thông qua m3u8, hiện tại script nó dectect 1 video mà chục link loạn luôn nên mình play link chính luôn.
mpv "https://video.twimg.com/amplify_video/1664007149436149760/vid/1920x1080/YEBErlMgK8y-qvEm.mp4?tag=16"
mpv "https://video.twimg.com/amplify_video/1664007149436149760/vid/640x360/iDGXbadW3wfEl0wI.mp4?tag=16"
Range
header một xong tự ngắt.Mình ghi thêm vào bài này rồi: Cách dùng MPV+Streamlink để xem livestream như Twitch, Youtube, Facebook...
Mình test thử thì thấy vấn đề lớn là không xem được chứ không phải là tải chậm:
Code:mpv "https://video.twimg.com/amplify_video/1664007149436149760/vid/1920x1080/YEBErlMgK8y-qvEm.mp4?tag=16" mpv "https://video.twimg.com/amplify_video/1664007149436149760/vid/640x360/iDGXbadW3wfEl0wI.mp4?tag=16"
Mở thử: https://streamable.com/v546ey
Mình kiểm tra trong log của proxy thấy MPV nó cứ tải từngRange
header một xong tự ngắt.
Có vẻ do Twitter họ dùng định dạng MP4 gì đó khiến MPV không chịu mở, tuy nhiên khi mình cache lại và mở trong cache thì ok: https://streamable.com/sbyozg
Có thể đây là một lỗi xử lý Partial Content của MPV, nên báo lên Github của họ xem sao nhé (nên báo vì đây có vẻ đây là một lỗi lớn): https://github.com/mpv-player/mpv/issues
Còn về vấn đề chất lượng thì hoàn toàn có thể chỉnh bằng uosc/quality-menu plugin:
mpv https://twitter.com/TheBabylonBee/status/1664014211956236288 ─╯
stream: Failed to open https://twitter.com/TheBabylonBee/status/1664014211956236288.
cplayer: (+) Video --vid=1 (*) (h264 1920x1080 23.977fps)
cplayer: (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
cplayer: (+) Subs --sid=1 --slang=en 'vtt' (webvtt) (external)
cplayer: VO: [gpu] 1920x1080 yuv420p
cplayer: AO: [pipewire] 48000Hz stereo 2ch floatp
term-msg: Resolution: 1920x1080, Framerate: 0.000 Hz
statusline: AV: 00:00:00 / 01:07:31 (0%) A-V: 0.000 Cache: 0.6s/44KB
[+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------]
cplayer: Audio device underrun detected.
statusline: (Buffering) AV: 00:00:00 / 01:07:31 (0%) A-V: 0.000 Cache: 0.7s/42KB
[+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------]
markwatched: [Cookies] Extracting cookies from firefox
markwatched: [Cookies] Extracted 2880 cookies from firefox
markwatched: Available version: [email protected], Current version: [email protected]
markwatched: yt-dlp is up to date ([email protected])
markwatched: [twitter] Extracting URL: https://twitter.com/TheBabylonBee/status/1664014211956236288
markwatched: [twitter] 1664014211956236288: Downloading JSON metadata
markwatched: [twitter] 1664014211956236288: Downloading m3u8 information
markwatched: [info] 1664007149436149760: Downloading 1 format(s): http-10368
markwatched:
markwatched: [debug] Command-line config: ['--cookies-from-browser', 'firefox:xxxx.default-release', '--mark-watched', '-vU', '--simulate', 'https://twitter.com/TheBabylonBee/status/1664014211956236288']
markwatched: [debug] User config "xxx/yt-dlp/config": ['--ignore-errors', '--user-agent', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36']
markwatched: [debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
markwatched: [debug] yt-dlp version [email protected] [392389b7d]
markwatched: [debug] Python 3.11.3 (CPython x86_64 64bit) - Linux-6.1.31-1-lts-x86_64-with-glibc2.37 (OpenSSL 3.0.9 30 May 2023, glibc 2.37)
markwatched: [debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0
markwatched: [debug] Optional libraries: Cryptodome-3.12.0, brotlicffi-1.0.9.2, certifi-2023.05.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
markwatched: [debug] Extracting cookies from: "xxx.default-release/cookies.sqlite"
markwatched: [debug] Proxy map: {}
markwatched: [debug] Loaded 1786 extractors
markwatched: [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
markwatched: [debug] [twitter] Using GraphQL API (Auth = True)
markwatched: [debug] [twitter] Extracting from video info: 1664007149436149760
markwatched: [debug] Sort order given by extractor: res, br, size, proto
markwatched: [debug] Formats sorted by: hasvid, ie_pref, res, tbr, vbr, abr, filesize, fs_approx, proto, lang, quality, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, asr, vext, aext, hasaud, source, id
markwatched: [debug] Default format spec: bestvideo*+bestaudio/best
markwatched:
statusline: AV: 00:00:00 / 01:07:31 (0%) A-V: 0.000 Cache: 0.6s/25KB
[+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------]
cplayer: Audio device underrun detected.
statusline: AV: 00:00:01 / 01:07:31 (0%) A-V: 0.000 Cache: 0.6s/24KB
[+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------]
cplayer: Audio device underrun detected.
statusline: (...) AV: 00:42:31 / 01:07:31 (63%) A-V: 0.000 Cache: 0.0s
[-----------------------------------------------------------------------------------------------------------+----------------------------------------------------------------]
cplayer: Saving state.
ffmpeg/demuxer: mov,mp4,m4a,3gp,3g2,mj2: stream 0, offset 0x10fcb5ca: partial file
cplayer:
Đã tạo issue để xem có nhiều người bị không nữaMình test thử thì thấy vấn đề lớn là không xem được chứ không phải là tải chậm:
Code:mpv "https://video.twimg.com/amplify_video/1664007149436149760/vid/1920x1080/YEBErlMgK8y-qvEm.mp4?tag=16" mpv "https://video.twimg.com/amplify_video/1664007149436149760/vid/640x360/iDGXbadW3wfEl0wI.mp4?tag=16"
Mở thử: https://streamable.com/v546ey
Mình kiểm tra trong log của proxy thấy MPV nó cứ tải từngRange
header một xong tự ngắt.
Có vẻ do Twitter họ dùng định dạng MP4 gì đó khiến MPV không chịu mở, tuy nhiên khi mình cache lại và mở trong cache thì ok: https://streamable.com/sbyozg
Có thể đây là một lỗi xử lý Partial Content của MPV, nên báo lên Github của họ xem sao nhé (nên báo vì đây có vẻ đây là một lỗi lớn): https://github.com/mpv-player/mpv/issues
Mình cũng thấy y hệt, kèm theo cái proxy thâm nhập để lưu log network lại của mình thì hiện tượng này là do MPV nó tải vài bytes, sau đó nó ngắt, rồi lại tiếp tục lặp đi lặp lại.Đây là log của mình, nó play được nhưng load buffer có vấn đề nên lôi lên để mọi người cùng bàn
mpv "https://video.twimg.com/amplify_video/1664007149436149760/vid/640x360/iDGXbadW3wfEl0wI.mp4?tag=16" --http-proxy=http://127.0.0.1:9966 --config-dir=~~/smpv.conf
(+) Video --vid=1 (*) (h264 640x360 23.977fps)
(+) Audio --aid=1 (*) (aac 2ch 48000Hz)
VO: [gpu] 640x360 yuv420p
AO: [wasapi] 48000Hz stereo 2ch float
AV: 00:00:00 / 01:07:31 (0%) A-V: 0.000 Cache: 0.8s/16KB
Audio device underrun detected.
AV: 00:00:00 / 01:07:31 (0%) A-V: 0.000 Cache: 0.8s/16KB
Audio device underrun detected.
AV: 00:00:00 / 01:07:31 (0%) A-V: 0.000 Cache: 0.8s/13KB
Audio device underrun detected.
AV: 00:00:01 / 01:07:31 (0%) A-V: 0.000 Cache: 0.8s/13KB
Audio device underrun detected.
(Paused) AV: 00:00:01 / 01:07:31 (0%) A-V: 0.000 Cache: 1.1s/20KB
[ffmpeg] tls: mbedtls_ssl_read returned -0x0
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: stream 0, offset 0xafc8: partial file
[lavf] error reading packet: Invalid data found when processing input.
Connection aborted by client
, không phải Connection aborted by remote server
:Connection aborted by client
OptionRule.py:1855[TPP_26]Traceback (most recent call last):
File "OptionRule.py", line 1608, in action
varfrommain.wfile.write(data)
File "D:\Python\Lib\socket.py", line 724, in write
return self._sock.send(b)
^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\ssl.py", line 1210, in send
return self._sslobj.write(data)
^^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2393)
Vừa báo lỗi xong, nhìn chung làm cái lệnh đơn giản:Đã tạo issue để xem có nhiều người bị không nữa. Nhân tiện bác cho em xin cái giao diện mpv bác đang dùng với ạ
mpv "https://video.twimg.com/amplify_video/1664007149436149760/vid/640x360/iDGXbadW3wfEl0wI.mp4?tag=16" --no-config --log-file=twitter.log
stream level seek from xxx
, y hệt Range header trong proxy thâm nhập:[ 0.036][d][ffmpeg] tcp: Starting connection attempt to 146.75.112.158 port 443
[ 0.310][d][ffmpeg] tcp: Successfully connected to 146.75.112.158 port 443
[ 15.638][d][ffmpeg] resize stream to 131072 bytes, drop 0 bytes
[ 15.638][v][ffmpeg] Mime-type: 'video/mp4'
[ 15.638][d][ffmpeg] Stream opened successfully.
[ 15.638][v][demux] Trying demuxers for level=normal.
[ 15.638][d][demux] Trying demuxer: disc (force-level: normal)
[ 15.638][d][demux] Trying demuxer: edl (force-level: normal)
[ 15.696][d][demux] Trying demuxer: cue (force-level: normal)
[ 15.696][d][demux] Trying demuxer: rawaudio (force-level: normal)
[ 15.696][d][demux] Trying demuxer: rawvideo (force-level: normal)
[ 15.696][d][demux] Trying demuxer: mkv (force-level: normal)
[ 15.696][d][demux] Trying demuxer: libarchive (force-level: normal)
[ 15.811][d][demux] Trying demuxer: lavf (force-level: normal)
[ 15.818][v][lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[ 20.499][v][ffmpeg] stream level seek from 982311 to 1124539
[ 20.516][d][ffmpeg] tcp: Starting connection attempt to 146.75.112.158 port 443
[ 21.838][d][ffmpeg] tcp: Successfully connected to 146.75.112.158 port 443
[ 32.557][v][ffmpeg] stream level seek from 1125918 to 1258124
[ 32.562][d][ffmpeg] tcp: Starting connection attempt to 146.75.112.158 port 443
[ 32.712][d][ffmpeg] tcp: Successfully connected to 146.75.112.158 port 443
Cảm ơn thím và thím @nhoxbuondkny. Không nhấn được nút like cho các thím nên cảm ơn miệng.Mình cũng thấy y hệt, kèm theo cái proxy thâm nhập để lưu log network lại của mình thì hiện tượng này là do MPV nó tải vài bytes, sau đó nó ngắt, rồi lại tiếp tục lặp đi lặp lại.
nó kết nối đi kết nối lại bác ạ, em treo nó để đấy 10-15 phút thì vid bắt đầu chạy. Chạy được 1s thì nó lại buffer mất cả 20s, chịu rồiVừa báo lỗi xong, nhìn chung làm cái lệnh đơn giản:mpv "https://video.twimg.com/amplify_video/1664007149436149760/vid/640x360/iDGXbadW3wfEl0wI.mp4?tag=16" --no-config --log-file=twitter.log
Mình thấy đoạn này đáng ngờ, nó cứ liên tụcstream level seek from xxx
, y hệt Range header trong proxy thâm nhập:
Code:[ 0.036][d][ffmpeg] tcp: Starting connection attempt to 146.75.112.158 port 443 [ 0.310][d][ffmpeg] tcp: Successfully connected to 146.75.112.158 port 443 [ 15.638][d][ffmpeg] resize stream to 131072 bytes, drop 0 bytes [ 15.638][v][ffmpeg] Mime-type: 'video/mp4' [ 15.638][d][ffmpeg] Stream opened successfully. [ 15.638][v][demux] Trying demuxers for level=normal. [ 15.638][d][demux] Trying demuxer: disc (force-level: normal) [ 15.638][d][demux] Trying demuxer: edl (force-level: normal) [ 15.696][d][demux] Trying demuxer: cue (force-level: normal) [ 15.696][d][demux] Trying demuxer: rawaudio (force-level: normal) [ 15.696][d][demux] Trying demuxer: rawvideo (force-level: normal) [ 15.696][d][demux] Trying demuxer: mkv (force-level: normal) [ 15.696][d][demux] Trying demuxer: libarchive (force-level: normal) [ 15.811][d][demux] Trying demuxer: lavf (force-level: normal) [ 15.818][v][lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048. [ 20.499][v][ffmpeg] stream level seek from 982311 to 1124539 [ 20.516][d][ffmpeg] tcp: Starting connection attempt to 146.75.112.158 port 443 [ 21.838][d][ffmpeg] tcp: Successfully connected to 146.75.112.158 port 443 [ 32.557][v][ffmpeg] stream level seek from 1125918 to 1258124 [ 32.562][d][ffmpeg] tcp: Starting connection attempt to 146.75.112.158 port 443 [ 32.712][d][ffmpeg] tcp: Successfully connected to 146.75.112.158 port 443
mpv thì nó lo tất cả kết nối, yt-dlp chỉ chuyển giao link tải cho nó.Dùng riêng yt-dlp download riêng video thì load bình thường - lỗi đầu mpv rồi. Trước giờ phần connect mình tưởng yt-dlp ôm hết chứ =]]
ông dev bảo đấy là lỗi của yt-dlp bác ạ, không phải của mpvmpv thì nó lo tất cả kết nối, yt-dlp chỉ chuyển giao link tải cho nó.
Khi dùng streamlink thì streamlink mới là thằng nó bao vụ tải nên nhiều cái MPV không chơi được dùng streamlink lại ok.
Trường hợp này đúng là yt-dlp tải ngon, MPV thì không được, thật ra còn cách khác là dùng yt-dlp pipe sang MPV, thử xem nhé, không thực sự hữu dụng tuy nhiên thử cho vui và để biết thôi, mình chưa thành công trong việc biến cái pipe từ yt-dlp sang mpv thành nút của External Application bao giờ, đó là nhược điểm nên toàn phải chạy bằng cơm qua cmd.
Chuẩn 100% rồi, khi để yt-dlp tải rồi pipe sang MPV, ngon lành cành đào: https://streamable.com/w7i9vp
Kết luận là tất cả đều là lỗi của MPV.
Vãi cả vũ hà ông dev, mình chạy vớiông dev bảo đấy là lỗi của yt-dlp bác ạ, không phải của mpv
--no-ytdl
nghĩa là không dùng yt-dlp mà còn lỗi nữa:mpv "https://video.twimg.com/amplify_video/1664007149436149760/vid/640x360/iDGXbadW3wfEl0wI.mp4?tag=16" --no-ytdl --no-config --log-file=twitter.log
Cảm ơn thím, trước giờ cứ nghĩ combo mpv + yt-dlp thì yt-dlp download file về ném vào memory còn mpv play từ memorympv thì nó lo tất cả kết nối, yt-dlp chỉ chuyển giao link tải cho nó.
Khi dùng streamlink thì streamlink mới là thằng nó bao vụ tải nên nhiều cái MPV không chơi được dùng streamlink lại ok.
Trường hợp này đúng là yt-dlp tải ngon, MPV thì không được, thật ra còn cách khác là dùng yt-dlp pipe sang MPV, thử xem nhé, không thực sự hữu dụng tuy nhiên thử cho vui và để biết thôi, mình chưa thành công trong việc biến cái pipe từ yt-dlp sang mpv thành nút của External Application bao giờ, đó là nhược điểm nên toàn phải chạy bằng cơm qua cmd.
Chuẩn 100% rồi, khi để yt-dlp tải rồi pipe sang MPV, ngon lành cành đào: https://streamable.com/w7i9vp
Kết luận là tất cả đều là lỗi của MPV.
Doesn't work in ffplay so it's not mpv's fault either way.
cái lại là của em bắt được link ảnh gif, không bắt được link video khi vào hẳn bằng twitter, lạ thậtTrong mấy hôm tới mình sẽ thử debug sâu vụ này bằng cách dùng BurpSuite sửa lại buffer size/headers..., hiện tại nghi là do phần mạng chứ không phải phần hình, thấy ông dev chính bảo lỗi do FFMPEG, chắc lại phải dọn qua FFMPEG để báo thôi:
Doesn't work in ffplay so it's not mpv's fault either way.
Còn tạm thời cứ xem bằng M3U8 nhé, cái link đầu tiên khi mở Twitter chính là link xem được, đổi được phân giải.