linux에서 제공하는 표준 API는 존재하지 않아
C++에서도 클래스를 만들어 쓰거나, 별도의 함수를 만들어 써야 한다고 한다.

일단 Encoding은 isalnum() 이 아닐경우에는 %02X로 출력해주면 될 것으로 보이고
Decoding은 %[0-9a-f][0-9a-f] 일 경우에는 %c로 출력해주면 될 것으로 보인다.

Encoding은 한글자만 보면 되지만
Decoding은 두글자를 보면서 해야 해서 귀찮을듯..


아래는 소스가 있는 페이지 이지만, 검증은 아직 해보지 않았음
  [링크 : http://tistory.izyou.net/entry/URL-인코딩, 디코딩 클래스]
  [링크 : http://remipa.pe.kr/zog/?no=118]
  [링크 : http://demo.initech.com/?document_srl=237]
  [링크 : http://smok95.tistory.com/entry/URL-EncodeDecode]
Posted by 구차니

댓글을 달아 주세요

  1. 오호..이건 저에게 좀 유용할지도...뒤적뒤적.

    2010.04.13 10:50 [ ADDR : EDIT/ DEL : REPLY ]

웹(HTML)      https://www.youtube.com/results?search_query=검색어
RSS(XML)     http://gdata.youtube.com/feeds/base/videos?q=검색어
api(XML)       http://gdata.youtube.com/feeds/api/videos?q=검색어
Posted by 구차니

댓글을 달아 주세요

wget은 HTTP나 FTP 등의 프로토콜을 통해 웹페이지나 파일을 다운받는 유틸리티이다.
아무튼 youtube에서 파일로 다운로드 받기위해 주소를 변환해서 시도를 해도
403 Forbidden 에러만 날뿐 다운로드 되지 않는다.

아무튼 쿠키를 저장하고, 이를 다시 불러들여 다운로드를 시도하면 제대로 받아진다.
쿠키를 이용해서 세션이 달라지면, 이전의 내용은 무효화 되서 그런것으로 생각된다.

--no-cookies
Disable the use of cookies. Cookies are a mechanism for maintaining server-side state. The server sends the client a cookie using the Set-Cookie header, and the client responds with the same cookie upon further requests. Since cookies allow the server owners to keep track of visitors and for sites to exchange this information, some consider them a breach of privacy. The default is to use cookies; however, storing cookies is not on by default.


--load-cookies file
Load cookies from file before the first HTTP retrieval. file is a textual file in the format originally used by Netscape's cookies.txt file.

You will typically use this option when mirroring sites that require that you be logged in to access some or all of their content. The login process typically works by the web server issuing an http cookie upon receiving and verifying your credentials. The cookie is then resent by the browser when accessing that part of the site, and so proves your identity.

Mirroring such a site requires Wget to send the same cookies your browser sends when communicating with the site. This is achieved by ‘--load-cookies’—simply point Wget to the location of the cookies.txt file, and it will send the same cookies your browser would send in the same situation. Different browsers keep textual cookie files in different locations:

Netscape 4.x.
The cookies are in ~/.netscape/cookies.txt.
Mozilla and Netscape 6.x.
Mozilla's cookie file is also named cookies.txt, located somewhere under ~/.mozilla, in the directory of your profile. The full path usually ends up looking somewhat like ~/.mozilla/default/some-weird-string/cookies.txt.
Internet Explorer.
You can produce a cookie file Wget can use by using the File menu, Import and Export, Export Cookies. This has been tested with Internet Explorer 5; it is not guaranteed to work with earlier versions.
Other browsers.
If you are using a different browser to create your cookies, ‘--load-cookies’ will only work if you can locate or produce a cookie file in the Netscape format that Wget expects.

If you cannot use ‘--load-cookies’, there might still be an alternative. If your browser supports a “cookie manager”, you can use it to view the cookies used when accessing the site you're mirroring. Write down the name and value of the cookie, and manually instruct Wget to send those cookies, bypassing the “official” cookie support:

          wget --no-cookies --header "Cookie: name=value"


--save-cookies file
Save cookies to file before exiting. This will not save cookies that have expired or that have no expiry time (so-called “session cookies”), but also see ‘--keep-session-cookies’.


--keep-session-cookies
When specified, causes ‘--save-cookies’ to also save session cookies. Session cookies are normally not saved because they are meant to be kept in memory and forgotten when you exit the browser. Saving them is useful on sites that require you to log in or to visit the home page before you can access some pages. With this option, multiple Wget runs are considered a single browser session as far as the site is concerned.

Since the cookie file format does not normally carry session cookies, Wget marks them with an expiry timestamp of 0. Wget's ‘--load-cookies’ recognizes those as session cookies, but it might confuse other browsers. Also note that cookies so loaded will be treated as other session cookies, which means that if you want ‘--save-cookies’ to preserve them again, you must use ‘--keep-session-cookies’ again.


[링크 : http://www.gnu.org/software/wget/manual/html_node/HTTP-Options.html]

--save-cookies 로 저장한 youtube 쿠키이다. 음.. 무슨 의미지 -ㅁ-?
$ cat yt.cookie
# HTTP cookie file.
# Generated by Wget on 2010-04-10 11:57:59.
# Edit at your own risk.

.youtube.com    TRUE    /       FALSE   1586228278      PREF    f1=50000000&f2=8000000
.youtube.com    TRUE    /       FALSE   1291604278      VISITOR_INFO1_LIVE      FNfBrJzTQY

$ wget "https://www.youtube.com/watch?v=mdljV2uEs1A" --save-cookies yt.cookie
$ wget --load-cookies=yt.cookie "http://v22.lscache2.c.youtube.com/videoplayback?ip=211.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Ci
tag%2Calgorithm%2Cburst%2Cfactor&fexp=904405%2C900037&algorithm=throttle-factor&itag=35&ipbits=8&burst=40&sver=3&expire=1270890000&key=yt1&signature=5C611E956FB97E74D3435F8815A7A2376E3C61D4.C2C593CDDE0C15671462BB13C5404EC6927F7F7D&factor=1.25&id=99d963576b84b350" -O file.mp4
--2010-04-10 12:33:26--  http://v22.lscache2.c.youtube.com/videoplayback?ip=211.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor&fexp=904405%2C900037&algorithm=throttle-factor&itag=35&ipbits=8&burst=40&sver=3&expire=1270890000&key=yt1&signature=5C611E956FB97E74D3435F8815A7A2376E3C61D4.C2C593CDDE0C15671462BB13C5404EC6927F7F7D&factor=1.25&id=99d963576b84b350
Resolving v22.lscache2.c.youtube.com... 74.125.167.33
접속 v22.lscache2.c.youtube.com|74.125.167.33|:80... 접속됨.
HTTP request sent, awaiting response... 200 OK
Length: 15708973 (15M) [video/x-flv]
Saving to: `file.mp4'

100%[==========================================================================>] 15,708,973   105K/s   in 2m 0s

2010-04-10 12:35:27 (128 KB/s) - `file.mp4' saved [15708973/15708973]

URL이 너무 길어서 별도의 파일이름을 지정해주지 않으면
Cannot write to `videoplayback?ip=211.0.0.0&sparams=id,expire,ip,ipbits,itag,algorithm,burst,factor&fexp=904405,900037&algorithm=throttle-factor&itag=35&ipbits=8&burst=40&sver=3&expire=1270890000&key=yt1&signature=5C611E956FB97E74D3435F8815A7A2376E3C61D4.C2C593CDDE0C15671462BB13C5404EC6927F7F7D&factor=1.25&id=99d963576b84b350' (File name too long).
주소가 255자를 넘어서는 관계로, 파일 이름으로 하기에는 너무 길다고 에러가 발생한다.
반드시 -O filename 으로 별도의 이름을 지정해 주어야 한다.

2010/04/09 - youtube 동영상 페이지 fmt_map, fmt_url_map, fmt_list, fmt_stream_map
[링크 : http://kldp.org/node/75150]


Posted by 구차니

댓글을 달아 주세요

유튜브 페이지에는 4개의 변수가 존재한다.
일단 이 녀석들을 URL decoding 해주면 아래와 같은 값으로 나오게 된다.

fmt_mapfmt_list와 내용이  유사하며
fmt_url_mapfmt_stream_map 과 내용이 유사하다.

아무튼 다운로드 주소를 얻을려면 fmt_url_map / fmt_stream_map 중에 하나에서 빼내면 된다.

fmt_map=22/2000000/9/0/115,35/640000/9/0/115,34/0/9/0/115,5/0/7/0/0&mpu=True&hl=ko_KR&ad_flags=0&rv.5.length_seconds=243&rv.0.thumbnailUrl=http://i1.ytimg.com/vi/lzVFyWNzjtE/default.jpg&rv.7.author=allkpop&cid=11332&rv.1.length_seconds=240&ad_logging_flag=1&rv.2.id=2f5hg3FlYc4

fmt_url_map=22|http://v15.lscache4.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Cratebypass%2Coc%3AU0dWRVhNU19FSkNNNl9QR1dD&fexp=900023%2C901802&itag=22&ipbits=0&sver=3&ratebypass=yes&expire=1270825200&key=yt1&signature=428B55DAF445D856E5F8A704C91B635776474DC3.B807EF9FE3245923257F82EDCDDD2FB7EFC4CFAF&id=4c66f02fc912a449,


하지만.. 리눅스에서 wget으로는 다운로드 되지 않는다 OTL

$ wget "http://v15.lscache4.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Cratebypass%2Coc%3AU0dWRVhNU19FSkNNNl9QR1dD&fexp=900023%2C901802&itag=22&ipbits=0&sver=3&ratebypass=yes&expire=1270825200&key=yt1&signature=428B55DAF445D856E5F8A704C91B635776474DC3.B807EF9FE3245923257F82EDCDDD2FB7EFC4CFAF&id=4c66f02fc912a449"
--17:55:02--  http://v15.lscache4.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Cratebypass%2Coc%3AU0dWRVhNU19FSkNNNl9QR1dD&fexp=900023%2C901802&itag=22&ipbits=0&sver=3&ratebypass=yes&expire=1270825200&key=yt1&signature=428B55DAF445D856E5F8A704C91B635776474DC3.B807EF9FE3245923257F82EDCDDD2FB7EFC4CFAF&id=4c66f02fc912a449
Resolving v15.lscache4.c.youtube.com... 74.125.107.35
Connecting to v15.lscache4.c.youtube.com|74.125.107.35|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
17:55:02 ERROR 403: Forbidden.


2010/02/26 - [프로그램 사용/유튜브 (youtube)] - 유튜브 파일 다운로드 하기(download youtube as file)

Posted by 구차니

댓글을 달아 주세요

  1. 은근 복잡하네요.

    2010.04.12 13:37 신고 [ ADDR : EDIT/ DEL : REPLY ]

base는 웹상에서 RSS로 주어지는 URL
api는 gdata API 상에서 주어지는 URL 이다.

http://gdata.youtube.com/feeds/base/standardfeeds/
http://gdata.youtube.com/feeds/api/standardfeeds/

요녀석이 url중 api가 들어간 것의 내용(MiTeC XML Viwer)

요녀석이 url중 base가 들어간 것의 내용(MiTeC XML Viwer)


base는 각종 데이터가 웹형식이고
api는 XML 답게 데이터로 들어있다는 점이 다르다. expat 등으로 파싱을 위해서라면
api 에서 하는것이 좋을듯 하다.

2010/01/04 - [파일방] - MiTeC XML Viewer (Free!)

Posted by 구차니
TAG gdata, youtube

댓글을 달아 주세요

만우절 이벤트로 안되게 했을리는 없고..
머가 바뀌걸까?
Posted by 구차니

댓글을 달아 주세요

유튜브의 이미지는 일반적으로


http://i3.ytimg.com/vi/r3jyCf_Id2o/default.jpg

이런식으로 default.jpg로 나온다.
하지만 default.jpg 대신 hqdefault.jpg 로 하면 큰 사진으로 받아오게 된다.


http://i3.ytimg.com/vi/r3jyCf_Id2o/hqdefault.jpg


default는 120x90
hqdefault는 480x360 해상도로 제공된다.

ytimg.com 은..
YouTube IMaGe 의 약자인가?!


2010.04.09 추가
굳이 i3 이런식으로 숫자가 없어도 불려온다.
범용으로 사용하기에는
i.ytimg.com/vi/[videoid]/default.jpg 혹은
i.ytimg.com/vi/[videoid]/hqdefault.jpg 이 적절해 보인다.
Posted by 구차니

댓글을 달아 주세요

  1. 오호~ 재미있군욥~ hqdefault는 high quality 인가요?? @.@

    2010.03.16 19:28 [ ADDR : EDIT/ DEL : REPLY ]
    • 아! 전 HQ(본부)로 망상을 하고 있었는데요 ㅋㅋㅋ

      2010.03.16 19:32 [ ADDR : EDIT/ DEL ]
  2. 김효도르

    좋은 정보 감사합니다~

    2013.06.25 15:52 [ ADDR : EDIT/ DEL : REPLY ]

스테레오 카메라야 머.. 가격이 2배면 간단하게 구현가능한데
음.. 아무튼 어떻게 올리고 어떤 카테고리에 들어있는건진 모르겠지만
유튜브에서 셀로판지나 매직아이 보듯 3D로 볼수 있는 컨텐츠가 있었다.




[링크 : https://www.youtube.com/watch?v=SE-u3Ga_oOY&feature=channel]

여러가지 설정중에 Cross-eyed로 하면 매직아이 보듯 사파리눈 하듯 보면 보이는데
역시.. 자연스럽긴해도 눈아파 죽겠다 ㄱ-

제목이 "YouTube 3D Player Test ( yt3d:enable=true )" 이다.
[링크 : https://www.youtube.com/watch?v=89cGA4-yPRw&feature=related]
Posted by 구차니

댓글을 달아 주세요

  1. 바야흐로 3D 시대군요...
    뭔가를 볼 때 안경 쓰는 건 별로 안 좋은데.. 나중에는 그냥 보는 3D도 나오겠죠?

    2010.03.16 12:17 [ ADDR : EDIT/ DEL : REPLY ]
    • 아무튼 cross eyed로 오래봤더니 1시간동안 어지러워 죽는줄 알았어요 ㅋㅋ

      2010.03.16 13:20 [ ADDR : EDIT/ DEL ]
  2. 비밀댓글입니다

    2010.06.30 23:01 [ ADDR : EDIT/ DEL : REPLY ]
  3. 저거 내가쓴 것임
    에이~동영상인줄 알았네~
    뭐,성능은 좋네~
    참고로 난10살!

    2010.06.30 23:06 [ ADDR : EDIT/ DEL : REPLY ]

파이어폭스에서 URL에 한글이 들어간걸 복사하면은
%22 이런식으로 이상한(!) 문자가 복사된다.

이런 표기를
URL encoding + UTF-8 이라고 하는거 같은데
아무튼, 유튜브에서 내부적으로 인코딩된 녀석을 풀어주기에는
적절한 서비스인것으로 보인다.


[링크 : http://mimul.com/pebble/default/2009/08/21/1250862600000.html]
[링크 : http://www.mimul.com/examples/dencoder/] << 웹에서 인코딩/디코딩


[링크 : http://bdyne.net/?document_srl=11733] << 동시에 여러가지 보여줌

[링크 : http://kldp.org/node/76274]
Posted by 구차니

댓글을 달아 주세요

  1. URL인코딩/디코딩은 메모장2에서도 기본으로 지원하는 기능입니다. 흐흐흐 (근데 아무도 안써ㅠㅠ)

    2010.03.06 19:07 [ ADDR : EDIT/ DEL : REPLY ]

아래는 wireshark로 tcp 에서 긁어 본건데, 간단하게 URL을 빼내기는 힘들다라는 내용
[링크 : http://blog.scouta.com/2007/10/20/youtubes-h264-file-url/]

아래는 &t 에 &fmt 값으로 원하는 포맷으로 변경후 받는 내용
[링크 : http://blog.jimmyr.com/High_Quality_on_Youtube_11_2008.php]


하.지.만 될리가 없잖아 ㄱ-
아무튼 혼자서 또 삽질을 하면서 알아낸 것은


https://www.youtube.com/watch?v=TMZNXW7cFCs
이 녀석을 샘플로 말하자면

이 html 페이지를 열어 보면 다음과 같은 내용이 있다.
yt.setConfig({
            'VIDEO_ID': 'TMZNXW7cFCs',
            'VIDEO_TITLE': '게임테크 2010 시연 동영상  1',

            'SWF_URL': (yt.flash.canPlayV9Swf() ? (!yt.flash.canPlayH264Videos() ? "http://s.ytimg.com/yt/swf/watch-vfl148687.swf" : "http://s.ytimg.com/yt/swf/watch_as3-vfl148857.swf") : "http://s.ytimg.com/yt/swf/watch_v8-vfl148687.swf"),
            'SWF_ARGS': {"rv.2.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2FfmPjDH1sDfo%2Fdefault.jpg", "rv.7.length_seconds": "600", "rv.0.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPOcCzju_kqk", "rv.0.view_count": "7243", "enablecsi": "1", "rv.2.title": "%EC%97%94%EB%93%9C%EA%B2%8C%EC%9E%84+-+%EC%A7%80%EA%B5%AC+%EB%85%B8%EC%98%88%ED%99%94+%EC%B2%AD%EC%82%AC%EC%A7%84+8%2F14", "rv.7.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2F2rEfw1DEtts%2Fdefault.jpg", "rv.4.rating": "5.0", "length_seconds": "78", "rv.0.title": "%EC%97%94%EB%93%9C%EA%B2%8C%EC%9E%84+-+%EC%A7%80%EA%B5%AC+%EB%85%B8%EC%98%88%ED%99%94+%EC%B2%AD%EC%82%AC%EC%A7%84+14%2F14", "rv.7.author": "junjangsoh", "rv.7.title": "%EC%97%94%EB%93%9C%EA%B2%8C%EC%9E%84+-+%EC%A7%80%EA%B5%AC+%EB%85%B8%EC%98%88%ED%99%94+%EC%B2%AD%EC%82%AC%EC%A7%84+10%2F14", "rv.3.view_count": "6324", "allow_embed": "1", "rv.5.title": "%EC%97%94%EB%93%9C%EA%B2%8C%EC%9E%84+-+%EC%A7%80%EA%B5%AC+%EB%85%B8%EC%98%88%ED%99%94+%EC%B2%AD%EC%82%AC%EC%A7%84+5%2F14", "rv.0.length_seconds": "564", "rv.4.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2FnHQokcqw2uw%2Fdefault.jpg", "fmt_url_map": "22%7Chttp%3A%2F%2Fv20.lscache7.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cratebypass%26fexp%3D900023%252C901802%26itag%3D22%26ipbits%3D0%26sver%3D3%26ratebypass%3Dyes%26expire%3D1267196400%26key%3Dyt1%26signature%3D0F25C849B5E0697E2708D7FDF90873CA778C1814.33DA1EEAD4CC9692C5613494A2C564133BF81595%26id%3D4cc64d5d6edc142b%2C35%7Chttp%3A%2F%2Fv21.lscache2.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D900023%252C901802%26algorithm%3Dthrottle-factor%26itag%3D35%26ipbits%3D0%26burst%3D40%26sver%3D3%26expire%3D1267196400%26key%3Dyt1%26signature%3D241955F71A0A876EC7B6DB78E3E792F66F3F21AD.309C4F50111292184108BB359CEEF7A9A86B918F%26factor%3D1.25%26id%3D4cc64d5d6edc142b%2C34%7Chttp%3A%2F%2Fv2.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D900023%252C901802%26algorithm%3Dthrottle-factor%26itag%3D34%26ipbits%3D0%26burst%3D40%26sver%3D3%26expire%3D1267196400%26key%3Dyt1%26signature%3D6AE4B5BA71E0F02396287FFDA1DF821A6158B6AF.CB0891E42ADAB8317ECA61A64CF77DD79BE662AC%26factor%3D1.25%26id%3D4cc64d5d6edc142b%2C5%7Chttp%3A%2F%2Fv7.lscache3.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D900023%252C901802%26algorithm%3Dthrottle-factor%26itag%3D5%26ipbits%3D0%26burst%3D40%26sver%3D3%26expire%3D1267196400%26key%3Dyt1%26signature%3D5AD304AB9BCC13F8BD46205F6F5FD95EF491C5EB.AB6CB2D6EEAE16BAE8003D88D2628D4008065739%26factor%3D1.25%26id%3D4cc64d5d6edc142b", "rv.2.rating": "5.0", "csi_page_type": "watch", "keywords": "14", "cr": "KR", "rv.1.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DLUs4UPyE2AI", "rv.6.thumbnailUrl": "http%3A%2F%2Fi4.ytimg.com%2Fvi%2FCjn_lrc2b_k%2Fdefault.jpg", "rv.1.id": "LUs4UPyE2AI", "rv.3.rating": "5.0", "rv.6.title": "%EC%97%94%EB%93%9C%EA%B2%8C%EC%9E%84+-+%EC%A7%80%EA%B5%AC+%EB%85%B8%EC%98%88%ED%99%94+%EC%B2%AD%EC%82%AC%EC%A7%84+13%2F14", "fmt_list": "22%2F2000000%2F9%2F0%2F115%2C35%2F640000%2F9%2F0%2F115%2C34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0", "rv.7.id": "2rEfw1DEtts", "rv.1.title": "%EC%97%94%EB%93%9C%EA%B2%8C%EC%9E%84+-+%EC%A7%80%EA%B5%AC+%EB%85%B8%EC%98%88%ED%99%94+%EC%B2%AD%EC%82%AC%EC%A7%84+1%2F14", "rv.1.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FLUs4UPyE2AI%2Fdefault.jpg", "rv.6.length_seconds": "602", "rv.0.rating": "5.0", "watermark": "http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl106645.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfl100714.swf", "rv.6.author": "junjangsoh", "rv.5.id": "gfsJ3Eq_Zhs", "rv.4.author": "junjangsoh", "plid": "AASAfHyi-5gDThaQ", "rv.0.id": "POcCzju_kqk", "rv.3.length_seconds": "598", "rv.5.rating": "5.0", "rv.4.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnHQokcqw2uw", "sdetail": "p%3A%2Fvideos", "fexp": "900023%2C901802", "rv.1.author": "junjangsoh", "rv.1.rating": "5.0", "rv.4.title": "%EC%97%94%EB%93%9C%EA%B2%8C%EC%9E%84+-+%EC%A7%80%EA%B5%AC+%EB%85%B8%EC%98%88%ED%99%94+%EC%B2%AD%EC%82%AC%EC%A7%84+3%2F14", "rv.5.thumbnailUrl": "http%3A%2F%2Fi4.ytimg.com%2Fvi%2FgfsJ3Eq_Zhs%2Fdefault.jpg", "rv.5.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DgfsJ3Eq_Zhs", "rv.3.title": "%EC%97%94%EB%93%9C%EA%B2%8C%EC%9E%84+-+%EC%A7%80%EA%B5%AC+%EB%85%B8%EC%98%88%ED%99%94+%EC%B2%AD%EC%82%AC%EC%A7%84+4%2F14", "sourceid": "y", "rv.0.author": "junjangsoh", "rv.3.thumbnailUrl": "http%3A%2F%2Fi2.ytimg.com%2Fvi%2Fi27PAb-w0AY%2Fdefault.jpg", "rv.2.author": "junjangsoh", "rv.6.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCjn_lrc2b_k", "rv.7.rating": "5.0", "rv.3.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Di27PAb-w0AY", "fmt_map": "22%2F2000000%2F9%2F0%2F115%2C35%2F640000%2F9%2F0%2F115%2C34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0", "hl": "en_US", "rv.7.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2rEfw1DEtts", "rv.2.view_count": "5454", "rv.4.length_seconds": "611", "rv.4.view_count": "7731", "rv.2.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfmPjDH1sDfo", "rv.5.length_seconds": "600", "rv.0.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FPOcCzju_kqk%2Fdefault.jpg", "fmt_stream_map": "22%7Chttp%3A%2F%2Fv20.lscache7.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cratebypass%26fexp%3D900023%252C901802%26itag%3D22%26ipbits%3D0%26sver%3D3%26ratebypass%3Dyes%26expire%3D1267196400%26key%3Dyt1%26signature%3D0F25C849B5E0697E2708D7FDF90873CA778C1814.33DA1EEAD4CC9692C5613494A2C564133BF81595%26id%3D4cc64d5d6edc142b%2C35%7Chttp%3A%2F%2Fv21.lscache2.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D900023%252C901802%26algorithm%3Dthrottle-factor%26itag%3D35%26ipbits%3D0%26burst%3D40%26sver%3D3%26expire%3D1267196400%26key%3Dyt1%26signature%3D241955F71A0A876EC7B6DB78E3E792F66F3F21AD.309C4F50111292184108BB359CEEF7A9A86B918F%26factor%3D1.25%26id%3D4cc64d5d6edc142b%2C34%7Chttp%3A%2F%2Fv2.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D900023%252C901802%26algorithm%3Dthrottle-factor%26itag%3D34%26ipbits%3D0%26burst%3D40%26sver%3D3%26expire%3D1267196400%26key%3Dyt1%26signature%3D6AE4B5BA71E0F02396287FFDA1DF821A6158B6AF.CB0891E42ADAB8317ECA61A64CF77DD79BE662AC%26factor%3D1.25%26id%3D4cc64d5d6edc142b%2C5%7Chttp%3A%2F%2Fv7.lscache3.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D900023%252C901802%26algorithm%3Dthrottle-factor%26itag%3D5%26ipbits%3D0%26burst%3D40%26sver%3D3%26expire%3D1267196400%26key%3Dyt1%26signature%3D5AD304AB9BCC13F8BD46205F6F5FD95EF491C5EB.AB6CB2D6EEAE16BAE8003D88D2628D4008065739%26factor%3D1.25%26id%3D4cc64d5d6edc142b", "sk": "AN-IBdoG6rDwqBQ2JAmJ7AiKj79qzYtCC", "rv.1.view_count": "25631", "rv.1.length_seconds": "596", "rv.6.rating": "5.0", "rv.5.author": "junjangsoh", "vq": "medium", "rv.3.id": "i27PAb-w0AY", "rv.2.id": "fmPjDH1sDfo", "rv.2.length_seconds": "600", "rv.5.view_count": "6470", "t": "vjVQa1PpcFNMsS2pAI26JfksbOObe4nVZu_ORw-B1v4%3D", "rv.6.id": "Cjn_lrc2b_k", "video_id": "TMZNXW7cFCs", "rv.6.view_count": "5377", "rv.3.author": "junjangsoh", "rv.4.id": "nHQokcqw2uw", "rv.7.view_count": "4854"},
            'SWF_GAM_URL': null,
            'SWF_DC_URL': null,
            'SWF_EXPRESS_URL': null,
            'SWF_AD_EURL': null,
            'SWF_IS_PLAYING_ALL': false,
            'SWF_SET_WMODE': false,

            'SHOW_AUTOSHARE': true,
            'IS_WIDESCREEN': false,
            'IS_HD_AVAILABLE': true,
            'WIDE_PLAYER_STYLES':         ["watch-wide-mode"]
,
            'EMBED_URL': 'https://www.youtube.com/v/TMZNXW7cFCs&hl=en_US&fs=1',
            'VIDEO_LANGUAGE': 'EN',
            'VIDEO_USERNAME': 'say2420',
            'PLAY_NEXT_FROM': '',
            'PLAY_NEXT_COUNT': '0',
            'QL_AUTOSCROLL_DEST': 0,
            'LOCALE': 'en_US',
            'AXC': '',
            'SUBSCRIBE_AXC': '',

            'PLAYER_SAVE_QUALITY': true,

            'COMMENTS_THRESHHOLD': -5,
            'COMMENTS_FILTER': 0,
            'COMMENTS_PAGE_SIZE': 10,
            'COMMENTS_MAX_PAGE': 1,
            'COMMENTS_COUNT': 4,

            'IS_BRANDED_WATCH': false
        });

아무튼 저넘의 fmt_url_map을 들여다보자!
"22%7Chttp%3A%2F%2Fv20.lscache7.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cratebypass%26fexp%3D900023%252C901802%26itag%3D22%26ipbits%3D0%26sver%3D3%26ratebypass%3Dyes%26expire%3D1267196400%26key%3Dyt1%26signature%3D0F25C849B5E0697E2708D7FDF90873CA778C1814.33DA1EEAD4CC9692C5613494A2C564133BF81595%26id%3D4cc64d5d6edc142b%2C35%7Chttp%3A%2F%2Fv21.lscache2.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D900023%252C901802%26algorithm%3Dthrottle-factor%26itag%3D35%26ipbits%3D0%26burst%3D40%26sver%3D3%26expire%3D1267196400%26key%3Dyt1%26signature%3D241955F71A0A876EC7B6DB78E3E792F66F3F21AD.309C4F50111292184108BB359CEEF7A9A86B918F%26factor%3D1.25%26id%3D4cc64d5d6edc142b%2C34%7Chttp%3A%2F%2Fv2.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D900023%252C901802%26algorithm%3Dthrottle-factor%26itag%3D34%26ipbits%3D0%26burst%3D40%26sver%3D3%26expire%3D1267196400%26key%3Dyt1%26signature%3D6AE4B5BA71E0F02396287FFDA1DF821A6158B6AF.CB0891E42ADAB8317ECA61A64CF77DD79BE662AC%26factor%3D1.25%26id%3D4cc64d5d6edc142b%2C5%7Chttp%3A%2F%2Fv7.lscache3.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D900023%252C901802%26algorithm%3Dthrottle-factor%26itag%3D5%26ipbits%3D0%26burst%3D40%26sver%3D3%26expire%3D1267196400%26key%3Dyt1%26signature%3D5AD304AB9BCC13F8BD46205F6F5FD95EF491C5EB.AB6CB2D6EEAE16BAE8003D88D2628D4008065739%26factor%3D1.25%26id%3D4cc64d5d6edc142b"

무언의 규칙성이 느껴지지 않는가!?
그렇다면 치환을 고고싱~

%7C 는 |
%3A 는 :
%2F 는 /
%3F 는 ?
%26 는 &
%25 는 %
%2C 는 ,
%3D 는 =

이므로 치환을 하면

"22|http://v20.lscache7.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Cratebypass&fexp=900023%2C901802&itag=22&ipbits=0&sver=3&ratebypass=yes&expire=1267196400&key=yt1&signature=0F25C849B5E0697E2708D7FDF90873CA778C1814.33DA1EEAD4CC9692C5613494A2C564133BF81595&id=4cc64d5d6edc142b

,35|http://v21.lscache2.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor&fexp=900023%2C901802&algorithm=throttle-factor&itag=35&ipbits=0&burst=40&sver=3&expire=1267196400&key=yt1&signature=241955F71A0A876EC7B6DB78E3E792F66F3F21AD.309C4F50111292184108BB359CEEF7A9A86B918F&factor=1.25&id=4cc64d5d6edc142b

,34|http://v2.lscache8.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor&fexp=900023%2C901802&algorithm=throttle-factor&itag=34&ipbits=0&burst=40&sver=3&expire=1267196400&key=yt1&signature=6AE4B5BA71E0F02396287FFDA1DF821A6158B6AF.CB0891E42ADAB8317ECA61A64CF77DD79BE662AC&factor=1.25&id=4cc64d5d6edc142b

,5|http://v7.lscache3.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor&fexp=900023%2C901802&algorithm=throttle-factor&itag=5&ipbits=0&burst=40&sver=3&expire=1267196400&key=yt1&signature=5AD304AB9BCC13F8BD46205F6F5FD95EF491C5EB.AB6CB2D6EEAE16BAE8003D88D2628D4008065739&factor=1.25&id=4cc64d5d6edc142b"

의 내용이 나오게 된다.
아무튼 http:// 부터 클릭하면 다운로드를 하게 된다.
22>18 순으로 H.264를 지원하는 해상도 이므로 적절하게 다운로드!



2010/01/26 - [프로그램 사용/VLC] - VLC로 youtube 동영상 감상하기

Posted by 구차니

댓글을 달아 주세요

  1. 오호라....ㅋㅋㅋ 재밌네요... ㅋㅋㅋ

    2010.02.27 11:09 [ ADDR : EDIT/ DEL : REPLY ]
  2. 후럴! 뭐가 이리 복잡한가요?@.@
    (때려쳐!때려쳐!)

    2010.03.06 19:10 [ ADDR : EDIT/ DEL : REPLY ]
  3. 좋은 내용 감사합니당. 덕분에 java 코드를 고칠 수 있었어요 ㅎ

    2014.08.18 13:30 [ ADDR : EDIT/ DEL : REPLY ]
    • 오래전 글인데 여전히 동일한 방법으로 내용을 넣어두고 있나보네요 ^^
      그리고 이런건.. 댓글로 다시는 것도 좋지만 트랙백으로 해당 링크를 거는 것도 방법입니다 ^^

      좋은하루 되세요~!

      2014.08.18 14:00 신고 [ ADDR : EDIT/ DEL ]