Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netflix 的 CDN 检测会卡住 #14

Closed
Ninzero opened this issue Aug 17, 2021 · 18 comments
Closed

Netflix 的 CDN 检测会卡住 #14

Ninzero opened this issue Aug 17, 2021 · 18 comments

Comments

@Ninzero
Copy link

Ninzero commented Aug 17, 2021

在一部分机器上, 检测 Netflix Preferred CDN 会卡在那里, 原因不明, 安装 dnsutils 也没用, 机器为 Ubuntu 18.04.

@lmc999
Copy link
Owner

lmc999 commented Aug 17, 2021

请告知你的idc

@Ninzero
Copy link
Author

Ninzero commented Aug 17, 2021

JustVPS 和 ReadySpace 都会出现这个问题.

@lmc999
Copy link
Owner

lmc999 commented Aug 17, 2021

因为我没有这两家的机器,脚本里你可以看到具体获取到CDN信息的步骤,你可以尝试一下按脚本命令操作看看哪一步出问题。

@Ninzero
Copy link
Author

Ninzero commented Aug 17, 2021

我试了一下

CDNAddr=$(echo $tmpresult | python -m json.tool 2> /dev/null | grep 'name' | head -n 1 | cut -f3 -d"/")

这一行跑出来是空的 (CDNAddr 是空值)

@Ninzero
Copy link
Author

Ninzero commented Aug 17, 2021

我测试了一下, 要用 python3 才能正常跑, 用 python 会报 Command not found 的错.

@lmc999
Copy link
Owner

lmc999 commented Aug 18, 2021

请问运行以下这行命令你的机器有什么返回

curl -s --max-time 10 "https://api.fast.com/netflix/speedtest/v2?https=true&token=YXNkZmFzZGxmbnNkYWZoYXNkZmhrYWxm&urlCount=5"

@Ninzero
Copy link
Author

Ninzero commented Aug 18, 2021

{"client":{"ip":"*.*.*.*","asn":"7595","location":{"city":"Singapore","country":"SG"}},"targets":[{"name":"https://ipv4-c026-sin001-ix.1.oca.nflxvideo.net/speedtest?c=sg&n=7595&v=55&e=1629274828&t=Gyw1JLlGzIXYIikRNm6HOIWuWlDj3W_NS6vysg","url":"https://ipv4-c026-sin001-ix.1.oca.nflxvideo.net/speedtest?c=sg&n=7595&v=55&e=1629274828&t=Gyw1JLlGzIXYIikRNm6HOIWuWlDj3W_NS6vysg","location":{"city":"Singapore","country":"SG"}},{"name":"https://ipv4-c040-sin001-ix.1.oca.nflxvideo.net/speedtest?c=sg&n=7595&v=54&e=1629274828&t=iDBeNlyml5HS5KoAj4_Z9Cs-HP_BUxfm45Epkg","url":"https://ipv4-c040-sin001-ix.1.oca.nflxvideo.net/speedtest?c=sg&n=7595&v=54&e=1629274828&t=iDBeNlyml5HS5KoAj4_Z9Cs-HP_BUxfm45Epkg","location":{"city":"Singapore","country":"SG"}},{"name":"https://ipv4-c042-hkg001-ix.1.oca.nflxvideo.net/speedtest?c=sg&n=7595&v=54&e=1629274828&t=JfJgjmx16d7bZLYSVEeOIEpStGROufwx1bf25Q","url":"https://ipv4-c042-hkg001-ix.1.oca.nflxvideo.net/speedtest?c=sg&n=7595&v=54&e=1629274828&t=JfJgjmx16d7bZLYSVEeOIEpStGROufwx1bf25Q","location":{"city":"Tsuen Wan","country":"HK"}},{"name":"https://ipv4-c045-hkg001-ix.1.oca.nflxvideo.net/speedtest?c=sg&n=7595&v=21&e=1629274828&t=MQrq-yk6TvNoBTF5OirJz_iXG2s68cesI2ggxg","url":"https://ipv4-c045-hkg001-ix.1.oca.nflxvideo.net/speedtest?c=sg&n=7595&v=21&e=1629274828&t=MQrq-yk6TvNoBTF5OirJz_iXG2s68cesI2ggxg","location":{"city":"Tsuen Wan","country":"HK"}},{"name":"https://ipv4-c006-tyo001-ix.1.oca.nflxvideo.net/speedtest?c=sg&n=7595&v=55&e=1629274828&t=uoIV_fuMYtdyKI8sjKpRfmrbMiaQ1hBus1xSBw","url":"https://ipv4-c006-tyo001-ix.1.oca.nflxvideo.net/speedtest?c=sg&n=7595&v=55&e=1629274828&t=uoIV_fuMYtdyKI8sjKpRfmrbMiaQ1hBus1xSBw","location":{"city":"Tokyo","country":"JP"}}]}

@Ninzero
Copy link
Author

Ninzero commented Aug 18, 2021

我比较确定问题是 pythonpython3 的问题, 因为安装 python-is-python3 后脚本工作正常.

@lmc999
Copy link
Owner

lmc999 commented Aug 18, 2021

你可以分别执行这两条命令验证一下是不是python版本问题,如果返回结果一样,这样可以判断是不是python版本问题。因为脚本还有很多其他地方运行python -m json.tool来格式化json返回,如果python导致出错,脚本其他检测也会出现问题。而且我本人目前使用ubuntu 16.04,默认就是python2,而我没有出现过Netflix CDN卡住的问题,所以我不大认为是python版本问题。
反而有部分机器访问fast的api会返回403,而这个情况确实会导致检测卡住,不过已经修复了。麻烦你再帮忙验证一下

curl -s --max-time 10 "https://api.fast.com/netflix/speedtest/v2?https=true&token=YXNkZmFzZGxmbnNkYWZoYXNkZmhrYWxm&urlCount=5" | python2 -m json.tool
curl -s --max-time 10 "https://api.fast.com/netflix/speedtest/v2?https=true&token=YXNkZmFzZGxmbnNkYWZoYXNkZmhrYWxm&urlCount=5" | python3 -m json.tool

@Ninzero
Copy link
Author

Ninzero commented Aug 18, 2021

python3 的这条执行正常. 但 python2 显示 Command 'python2' not found

@Ninzero
Copy link
Author

Ninzero commented Aug 18, 2021

你可以分别执行这两条命令验证一下是不是 python 版本问题,如果返回结果一样,这样可以判断是不是 python 版本问题。因为脚本还有很多其他地方运行 python -m json.tool 来格式化 json 返回,如果 python 导致出错,脚本其他检测也会出现问题。而且我本人目前使用 ubuntu 16.04,默认就是 python2,而我没有出现过 Netflix CDN 卡住的问题,所以我不大认为是 python 版本问题。

目前来看默认使用 python2 的机器没什么问题, 默认 python3 的反而会出问题

@lmc999
Copy link
Owner

lmc999 commented Aug 18, 2021

脚本其实会默认软连python3到python的,但是前段时间我修改了一下python的安装步骤,估计是软连失败了,现在改回来了

@Ninzero
Copy link
Author

Ninzero commented Aug 18, 2021

脚本其实会默认软连 python3 到 python 的,但是前段时间我修改了一下 python 的安装步骤,估计是软连失败了,现在改回来了

刚刚测试, 使用 a4b1aec 这一版本的脚本依然存在这一问题.

@ltdstudio
Copy link

同样的~

@lmc999
Copy link
Owner

lmc999 commented Aug 19, 2021

现在试试吧,昨天群友找出来是python2的编码问题,现在获取CDN地址那一步已经去掉python了

@Ninzero
Copy link
Author

Ninzero commented Aug 19, 2021

现在确实不会卡在 CDN 这一步了, 但是出现了 #13 这个问题

@lmc999
Copy link
Owner

lmc999 commented Aug 19, 2021

现在确实不会卡在 CDN 这一步了, 但是出现了 #13 这个问题

这是ip.sb上查不到你IP的ISP信息,这里无法处理

@Ninzero
Copy link
Author

Ninzero commented Aug 19, 2021

好的, 那这个问题应该算解决了, 我关 Issue 了

@Ninzero Ninzero closed this as completed Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants