Skip to content

Commit

Permalink
Fix parse url. Add info in README.
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonardo Gatica committed Mar 29, 2015
1 parent 4873922 commit d5ab467
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ Interactive mode
anime-dl
```

Show a chapter of a anime from url.

``` bash
anime-dl -u [url]
```

Show a chapter of a anime. Example of title: dragon-ball

``` bash
Expand All @@ -49,5 +55,11 @@ anime-dl -c [number] -t [title-anime] -v
Download a chapter of a anime. Example of title: dragon-ball. Require wget

``` bash
anime-dl -c [number] -t [title-anime] -f video.mp4
anime-dl -c [number] -t [title-anime] -f [filename]
```

Download a chapter from url. Require wget

``` bash
anime-dl -u [url] -f [filename]
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anime-dl",
"version": "1.3.0",
"version": "1.3.1",
"description": "CLI for show and download anime from jkanime.net.",
"main": "lib",
"dependencies": {
Expand Down
7 changes: 2 additions & 5 deletions src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ getUrlVideo = (animeUrl, cb) ->
if not err and response.statusCode is 200
$ = cheerio.load data.toString()
ANIME.title = $(".vervideo").text().split(" - ")[0]
ANIME.codeName = animeUrl.replace(url, "").replace("/", "")
ANIME.chapter = parseInt chapter, 10
[ANIME.codeName, ANIME.chapter] = animeUrl.replace(url, "").split "/"
try
links = $(".player_conte param[value^=file]")
value = links[links.length - 1].attribs.value
Expand All @@ -71,9 +70,7 @@ runPlayer = (url, player) ->
console.log "full title: #{ANIME.title}"
console.log "title: #{ANIME.codeName}"
console.log "chapter: #{ANIME.chapter}"
console.log "url: #{url}\n\n"
console.log "For see next chapter: #{yargs.argv["$0"]} -t " +
"#{ANIME.codeName} -c #{ANIME.chapter + 1}"
console.log "url: #{url}"
spawn player, [url],
detached: true
stdio: "ignore"
Expand Down

0 comments on commit d5ab467

Please sign in to comment.