This commit is contained in:
Jules Laplace
2015-07-11 00:43:12 -04:00
parent c4d9ffa024
commit 08c78b1858
2 changed files with 6 additions and 3 deletions

View File

@@ -3,8 +3,9 @@ ytmnd
ytmnd scraper. ytmnd scraper.
`./ytmnd.py -u _username_` `./ytmnd.py -u [username]`
`./ytmnd.py domain`
`./ytmnd.py [domain]`
serving serving
------- -------
@@ -18,12 +19,12 @@ options
| flag | description | | flag | description |
| -------------- | ----------------------- | | -------------- | ----------------------- |
| `--user` (or `-u`) | fetch all ytmnds for a user |
| `--media-only` | only download the gif and mp3 | | `--media-only` | only download the gif and mp3 |
| `--html-only` | only write an html file| | `--html-only` | only write an html file|
| `--json-only` | writes simplified json to a file | | `--json-only` | writes simplified json to a file |
| `--no-web-audio` | uses the <audio> tag instead of web audio | | `--no-web-audio` | uses the <audio> tag instead of web audio |
| `--print-json` | dumps raw json from ytmnd to stdout | | `--print-json` | dumps raw json from ytmnd to stdout |
| `--user` (or `-u`) | fetch all ytmnds for a user |
license license
------- -------

View File

@@ -74,6 +74,8 @@ class YTMND:
if self.print_json: if self.print_json:
print simplejson.dumps(ytmnd_info, sort_keys=True, indent=4 * ' ') print simplejson.dumps(ytmnd_info, sort_keys=True, indent=4 * ' ')
elif self.json_only: elif self.json_only:
if self.media_only:
self.fetch_media(ytmnd_info)
return self.parse_json(ytmnd_info) return self.parse_json(ytmnd_info)
elif self.media_only: elif self.media_only:
self.fetch_media(ytmnd_info) self.fetch_media(ytmnd_info)