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

metadata option #2343

Closed
davidhedlund opened this issue Feb 8, 2014 · 8 comments
Closed

metadata option #2343

davidhedlund opened this issue Feb 8, 2014 · 8 comments

Comments

@davidhedlund
Copy link

@davidhedlund davidhedlund commented Feb 8, 2014

There should be an option to show a list of meta data (eg youtube-dl -m 6ncmsdeWKYM). This would be fair as youtube-dl --list-formats exist

@davidhedlund
Copy link
Author

@davidhedlund davidhedlund commented Feb 8, 2014

I need it to get data that I can pass to vorbiscomment.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Feb 8, 2014

You can get the the info about the video as json with the -j option, for example youtube-dl -j 6ncmsdeWKYM produces:

{
  "title": "Koan - Sweet Dream",
  "uploader_id": "MyrchoSmile",
  "format": "18 - 640x360",
  "url": "LONG_URL",
  "width": 640,
  "thumbnail": "https://i1.ytimg.com/vi/6ncmsdeWKYM/hqdefault.jpg",
  "view_count": 47810,
  "stitle": "Koan - Sweet Dream",
  "extractor": "youtube",
  "height": 360,
  "age_limit": 0,
  "upload_date": "20090626",
  "webpage_url": "https://www.youtube.com/watch?v=6ncmsdeWKYM",
  "formats": [
   ... A long list
  ],
  "annotations": null,
  "format_id": "18",
  "dislike_count": 2,
  "extractor_key": "Youtube",
  "playlist": null,
  "like_count": 377,
  "ext": "mp4",
  "id": "6ncmsdeWKYM",
  "player_url": null,
  "playlist_index": null,
  "subtitles": null,
  "_filename": "Koan - Sweet Dream-6ncmsdeWKYM.mp4",
  "fulltitle": "Koan - Sweet Dream",
  "uploader": "MyrchoSmile",
  "webpage_url_basename": "6ncmsdeWKYM",
  "description": "Dreams Come True",
  "duration": 452
}

Also you may be interested in the --add-metadata option, it will add some info (title, author ...) to the final file metadata.

If this options are enough, please comment so that we can close the issue.

@davidhedlund
Copy link
Author

@davidhedlund davidhedlund commented Feb 8, 2014

Thanks. For me it ouputs

{"upload_date": "20090626", "description": "Dreams Come True",
"extractor": "youtube", "height": 360, "_filename": "Koan - Sweet
Dream-6ncmsdeWKYM.mp4", "like_count": 377, "uploader": "MyrchoSmile",
"duration": 452, "format_id": "18", "player_url": null, "uploader_id":
"MyrchoSmile", "subtitles": null, "stitle": "Koan - Sweet Dream",
"view_count": 47814, "playlist": null, "title": "Koan - Sweet Dream",
"url":
"http://r2---sn-uuigxx-ch5e.googlevideo.com/videoplayback?key=yt5&ms=au&fexp=919111%2C945000%2C929202%2C916626%2C937417%2C913434%2C936910%2C936913&sparams=id%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&mv=m&upn=KB5EptOgoG8&source=youtube&mt=1391901406&ip=213.21.93.144&itag=18&expire=1391927297&ratebypass=yes&sver=3&id=ea7726b1d7962983&ipbits=0&signature=091275292323EEB724E3194778A7F5A69DAA9C5C.8DA1F29884C29D244B24D029B21208E8349A8B5E",
"extractor_key": "Youtube", "id": "6ncmsdeWKYM", "format": "18 -
640x360", "annotations": null, "dislike_count": 2, "width": 640, "ext":
"mp4", "playlist_index": null, "webpage_url":
"https://www.youtube.com/watch?v=6ncmsdeWKYM", "formats": [{"format":
"140 - audio only (DASH audio)", "url":
"http://r2---sn-uuigxx-ch5e.googlevideo.com/videoplayback?key=yt5&gir=yes&signature=4DF022E79FD11823A87CC51C45961C2F84EFA22E.8519B6DFCE0E5B1A87F32B14C88D70DC9FC8EC8D&fexp=919111%2C945000%2C929202%2C916626%2C937417%2C913434%2C936910%2C936913&factor=1.25&lmt=1378004249993655&algorithm=throttle-factor&burst=40&expire=1391927297&sver=3&dur=451.140&ipbits=0&upn=h3LoXE0GSfQ&source=youtube&itag=140&ms=au&sparams=algorithm%2Cburst%2Cclen%2Cdur%2Cfactor%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Clmt%2Csource%2Cupn%2Cexpire&mv=m&mt=1391901406&ip=213.21.93.144&clen=7165736&id=ea7726b1d7962983&ratebypass=yes",
"vcodec": "none", "format_note": "DASH audio", "abr": 128, "player_url":
null, "ext": "m4a", "preference": -50, "format_id": "140"}, {"format":
"160 - 192p (DASH video)", "url":
"http://r2---sn-uuigxx-ch5e.googlevideo.com/videoplayback?key=yt5&gir=yes&signature=509303535975E57C03CB6A53AAE4FA9E5B119089.59DC3A289C87832215671BEBCF324CC77F357A87&fexp=919111%2C945000%2C929202%2C916626%2C937417%2C913434%2C936910%2C936913&factor=1.25&lmt=1378004215706670&algorithm=throttle-factor&burst=40&expire=1391927297&sver=3&dur=451.040&ipbits=0&upn=h3LoXE0GSfQ&source=youtube&itag=160&ms=au&sparams=algorithm%2Cburst%2Cclen%2Cdur%2Cfactor%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Clmt%2Csource%2Cupn%2Cexpire&mv=m&mt=1391901406&ip=213.21.93.144&clen=6247595&id=ea7726b1d7962983&ratebypass=yes",
"format_note": "DASH video", "player_url": null, "ext": "mp4",
"preference": -40, "format_id": "160", "height": 192, "resolution":
"192p"}, {"format": "133 - 240p (DASH video)", "url":
"http://r2---sn-uuigxx-ch5e.googlevideo.com/videoplayback?key=yt5&gir=yes&signature=8B2DBB811A01546FBBF28B9B7A1C4AE33AAE359E.C3C034DF6C4DA8B91130F863B9BE349B61148F07&fexp=919111%2C945000%2C929202%2C916626%2C937417%2C913434%2C936910%2C936913&factor=1.25&lmt=1378004227009005&algorithm=throttle-factor&burst=40&expire=1391927297&sver=3&dur=451.040&ipbits=0&upn=h3LoXE0GSfQ&source=youtube&itag=133&ms=au&sparams=algorithm%2Cburst%2Cclen%2Cdur%2Cfactor%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Clmt%2Csource%2Cupn%2Cexpire&mv=m&mt=1391901406&ip=213.21.93.144&clen=13750509&id=ea7726b1d7962983&ratebypass=yes",
"format_note": "DASH video", "player_url": null, "ext": "mp4",
"preference": -40, "format_id": "133", "height": 240, "resolution":
"240p"}, {"format": "134 - 360p (DASH video)", "url":
"http://r2---sn-uuigxx-ch5e.googlevideo.com/videoplayback?key=yt5&gir=yes&signature=AB5AC0DBBF8820EDB15234DC99029E0E3328B25B.1138C4ABC23B88F27A93E7FC8C36AF7C2F85B5F3&fexp=919111%2C945000%2C929202%2C916626%2C937417%2C913434%2C936910%2C936913&factor=1.25&lmt=1378004228075305&algorithm=throttle-factor&burst=40&expire=1391927297&sver=3&dur=451.040&ipbits=0&upn=h3LoXE0GSfQ&source=youtube&itag=134&ms=au&sparams=algorithm%2Cburst%2Cclen%2Cdur%2Cfactor%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Clmt%2Csource%2Cupn%2Cexpire&mv=m&mt=1391901406&ip=213.21.93.144&clen=23167694&id=ea7726b1d7962983&ratebypass=yes",
"format_note": "DASH video", "player_url": null, "ext": "mp4",
"preference": -40, "format_id": "134", "height": 360, "resolution":
"360p"}, {"format": "135 - 480p (DASH video)", "url":
"http://r2---sn-uuigxx-ch5e.googlevideo.com/videoplayback?key=yt5&gir=yes&signature=95471D0F86F69583939F27CA49A833F207FC8969.359B1165977399017C108663F6BDBF061E1189A2&fexp=919111%2C945000%2C929202%2C916626%2C937417%2C913434%2C936910%2C936913&factor=1.25&lmt=1378004228076089&algorithm=throttle-factor&burst=40&expire=1391927297&sver=3&dur=451.040&ipbits=0&upn=h3LoXE0GSfQ&source=youtube&itag=135&ms=au&sparams=algorithm%2Cburst%2Cclen%2Cdur%2Cfactor%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Clmt%2Csource%2Cupn%2Cexpire&mv=m&mt=1391901406&ip=213.21.93.144&clen=46611771&id=ea7726b1d7962983&ratebypass=yes",
"format_note": "DASH video", "player_url": null, "ext": "mp4",
"preference": -40, "format_id": "135", "height": 480, "resolution":
"480p"}, {"width": 176, "ext": "3gp", "format": "17 - 176x144", "url":
"http://r2---sn-uuigxx-ch5e.googlevideo.com/videoplayback?key=yt5&factor=1.25&fexp=919111%2C945000%2C929202%2C916626%2C937417%2C913434%2C936910%2C936913&sparams=algorithm%2Cburst%2Cfactor%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&ms=au&upn=KB5EptOgoG8&burst=40&mv=m&source=youtube&ip=213.21.93.144&algorithm=throttle-factor&itag=17&expire=1391927297&mt=1391901406&sver=3&id=ea7726b1d7962983&ipbits=0&signature=62DA995A3D8BE476E9B7307FADCA6482F2A0D6D5.4F3D323696CF82180E0E49854EF2CA70B57CE395&ratebypass=yes",
"format_id": "17", "height": 144, "player_url": null}, {"width": 400,
"ext": "flv", "format": "5 - 400x240", "url":
"http://r2---sn-uuigxx-ch5e.googlevideo.com/videoplayback?key=yt5&factor=1.25&fexp=919111%2C945000%2C929202%2C916626%2C937417%2C913434%2C936910%2C936913&sparams=algorithm%2Cburst%2Cfactor%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&ms=au&upn=KB5EptOgoG8&burst=40&mv=m&source=youtube&ip=213.21.93.144&algorithm=throttle-factor&itag=5&expire=1391927297&mt=1391901406&sver=3&id=ea7726b1d7962983&ipbits=0&signature=790DF976F762FA5B5928C2B9A24B4B96125CC1C6.84D12384A388B23769308BD11E355686DE78501F&ratebypass=yes",
"format_id": "5", "height": 240, "player_url": null}, {"width": 640,
"ext": "webm", "format": "43 - 640x360", "url":
"http://r2---sn-uuigxx-ch5e.googlevideo.com/videoplayback?key=yt5&ms=au&fexp=919111%2C945000%2C929202%2C916626%2C937417%2C913434%2C936910%2C936913&sparams=id%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&mv=m&upn=KB5EptOgoG8&source=youtube&mt=1391901406&ip=213.21.93.144&itag=43&expire=1391927297&ratebypass=yes&sver=3&id=ea7726b1d7962983&ipbits=0&signature=D46AF6EFC641C8C1EE9B90A64F440071F6A086CE.9F06D80A948E0CAFFE8C846A32F37C86BB5CF8BD",
"format_id": "43", "height": 360, "player_url": null}, {"width": 640,
"ext": "mp4", "format": "18 - 640x360", "url":
"http://r2---sn-uuigxx-ch5e.googlevideo.com/videoplayback?key=yt5&ms=au&fexp=919111%2C945000%2C929202%2C916626%2C937417%2C913434%2C936910%2C936913&sparams=id%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&mv=m&upn=KB5EptOgoG8&source=youtube&mt=1391901406&ip=213.21.93.144&itag=18&expire=1391927297&ratebypass=yes&sver=3&id=ea7726b1d7962983&ipbits=0&signature=091275292323EEB724E3194778A7F5A69DAA9C5C.8DA1F29884C29D244B24D029B21208E8349A8B5E",
"format_id": "18", "height": 360, "player_url": null}], "fulltitle":
"Koan - Sweet Dream", "age_limit": 0, "thumbnail":
"https://i1.ytimg.com/vi/6ncmsdeWKYM/hqdefault.jpg",
"webpage_url_basename": "6ncmsdeWKYM"}

How do I add line breaks as in your instance?

On 2014-02-08 22:04, Jaime Marquínez Ferrándiz wrote:

You can get the the info about the video as json with the |-j| option,
for example |youtube-dl -j 6ncmsdeWKYM| produces:

{
"title": "Koan - Sweet Dream",
"uploader_id": "MyrchoSmile",
"format": "18 - 640x360",
"url": "LONG_URL",
"width": 640,
"thumbnail": "https://i1.ytimg.com/vi/6ncmsdeWKYM/hqdefault.jpg",
"view_count": 47810,
"stitle": "Koan - Sweet Dream",
"extractor": "youtube",
"height": 360,
"age_limit": 0,
"upload_date": "20090626",
"webpage_url": "https://www.youtube.com/watch?v=6ncmsdeWKYM",
"formats": [
... A long list
],
"annotations": null,
"format_id": "18",
"dislike_count": 2,
"extractor_key": "Youtube",
"playlist": null,
"like_count": 377,
"ext": "mp4",
"id": "6ncmsdeWKYM",
"player_url": null,
"playlist_index": null,
"subtitles": null,
"_filename": "Koan - Sweet Dream-6ncmsdeWKYM.mp4",
"fulltitle": "Koan - Sweet Dream",
"uploader": "MyrchoSmile",
"webpage_url_basename": "6ncmsdeWKYM",
"description": "Dreams Come True",
"duration": 452
}

Also you may be interested in the |--add-metadata| option, it will add
some info (title, author ...) to the final file metadata.

If this options are enough, please comment so that we can close the issue.


Reply to this email directly or view it on GitHub
#2343 (comment).

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Feb 9, 2014

You can use jq: youtube-dl -j 6ncmsdeWKYM | jq '.'. But if you are using the metadata inside a program, it shouldn't matter.

@davidhedlund
Copy link
Author

@davidhedlund davidhedlund commented Feb 10, 2014

On 2014-02-09 10:47, Jaime Marquínez Ferrándiz wrote:

You can use jq http://stedolan.github.io/jq/: |youtube-dl -j
6ncmsdeWKYM | jq '.'|. But if you are using the metadata inside a
program, it shouldn't matter.


Reply to this email directly or view it on GitHub
#2343 (comment).

I cannot find "jq" as package for installation. Using Ubuntu based
distro Trisquel.

@phihag
Copy link
Contributor

@phihag phihag commented Feb 10, 2014

The jq packages is available in Ubuntu, so you may be able to use that. Alternatively, install it manually. In any case, if you want to extract information, it will often be easier to simply use your programming language's facilities.

Also, you mentioned vorbiscomment. If you simply want to have the title and description in encoded in the file, why not pass in --add-metadata? That should get you a file with the desired metadata.

@phihag phihag closed this Feb 10, 2014
@davidhedlund
Copy link
Author

@davidhedlund davidhedlund commented Feb 10, 2014

Also, you mentioned vorbiscomment. If you simply want to have the title
and description in encoded in the file, why not pass in
|--add-metadata|? That should get you a file with the desired metadata.


Reply to this email directly or view it on GitHub
#2343 (comment).

How do you mean? I want to extract the meta data with youtube-dl and
then pass it to vorbiscomment.

@phihag
Copy link
Contributor

@phihag phihag commented Feb 10, 2014

Yes, but why do you want to do that? I'd assume you want the song title and description encoded in the vorbis file.

That is precisely what --add-metadata does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.