我有这样的网址:
HTTP%253A%252F%252Fo-o.preferred.bom03s03.v18.lscache5.c.youtube.com%252Fvideoplayback%253Fsparams%253Dalgorithm%25252Cburst%25252Ccp%25252Cfactor%25252Cid%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Cexpire %2526fexp%253D906717%25252C903945%25252C912602%25252C913601%25252C901601%2526algorithm%253Dthrottle因子%2526itag%253D34%2526ip%253D59.0.0.0%2526burst%253D40%2526sver%253D3%2526signature%253D904B7C772910BF285A6068BC1B5F5BB326A15A67.A0A3B85945C69A12B590D3D61695A3095039728D%2526source%253Dyoutube%2526expire %253D1331814444%2526key%253Dyt1%2526ipbits%253D8%2526factor%253D1.25%2526cp%253DU0hSRlhMUl9JTkNOMl9QRlZFOkVoSFJkckpoeHMw%2526id%253D4749aebe2c52addd
如何从中获取实际网址。我尝试了HttpUtility.UrlDecode
和其他各种实用方法。但似乎没有任何效果。任何人都可以告诉我什么是%253A
和其他角色。它似乎是Unicode,但如何从中获取可以实际粘贴在浏览器中的URL?
答案 0 :(得分:3)
它被加倍编码。
尝试
Console.Write(HttpUtility.UrlDecode(HttpUtility.UrlDecode(@"http%253A%252F%252Fo-o.preferred.bom03s03.v18.lscache5.c.youtube.com%252Fvideoplayback%253Fsparams%253Dalgorithm%25252Cburst%25252Ccp%25252Cfactor%25252Cid%25252Cip%25252Cipbits%25252Citag%25252Csource%25252Cexpire%2526fexp%253D906717%25252C903945%25252C912602%25252C913601%25252C901601%2526algorithm%253Dthrottle-factor%2526itag%253D34%2526ip%253D59.0.0.0%2526burst%253D40%2526sver%253D3%2526signature%253D904B7C772910BF285A6068BC1B5F5BB326A15A67.A0A3B85945C69A12B590D3D61695A3095039728D%2526source%253Dyoutube%2526expire%253D1331814444%2526key%253Dyt1%2526ipbits%253D8%2526factor%253D1.25%2526cp%253DU0hSRlhMUl9JTkNOMl9QRlZFOkVoSFJkckpoeHMw%2526id%253D4749aebe2c52addd")));
结果:
http://o-o.preferred.bom03s03.v18.lscache5.c.youtube.com/videoplayback?sparams=algorithm%2Cburst%2Ccp%2Cfactor%2Cid%2Cip
%2Cipbits%2Citag%2Csource%2Cexpire&fexp=906717%2C903945%2C912602%2C913601%2C901601&algorithm=throttle-factor&itag=34&ip=
59.0.0.0&burst=40&sver=3&signature=904B7C772910BF285A6068BC1B5F5BB326A15A67.A0A3B85945C69A12B590D3D61695A3095039728D&sou
rce=youtube&expire=1331814444&key=yt1&ipbits=8&factor=1.25&cp=U0hSRlhMUl9JTkNOMl9QRlZFOkVoSFJkckpoeHMw&id=4749aebe2c52ad
dd