-
Notifications
You must be signed in to change notification settings - Fork 4
Update plugin Anime #31
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ | |
| def CATEGORIES(): | ||
| addon.addDir("Szukaj anime", '', mode=1) | ||
| addon.addDir("Alfabetycznie", '', mode=10) | ||
| addon.addDir("Alfabetyczniefilmy", '', mode=15) | ||
| addon.addDir("Gatunki", '', mode=20) | ||
| addon.addDir("Sezony", '', mode=30) | ||
| addon.addDir("Rankingi", '', mode=40) | ||
|
|
@@ -77,7 +78,7 @@ def Wyszukiwanie(): | |
| def Alfabetycznie(): | ||
| url = 'http://animezone.pl' | ||
|
|
||
| r = client.request('http://animezone.pl/anime/lista') | ||
| r = client.request('https://www.animezone.pl/anime/lista') | ||
|
|
||
| result = client.parseDOM(r, 'div', attrs={'class': 'btn-group btn-group-xs'}) | ||
| linki_litery = client.parseDOM(result, 'a', ret='href') | ||
|
|
@@ -88,6 +89,19 @@ def Alfabetycznie(): | |
| addon.addDir(str(litery[counter]), link, mode=3) | ||
| counter += 1 | ||
|
|
||
| def Alfabetyczniefilmy(): | ||
| url = 'http://animezone.pl' | ||
|
|
||
| r = client.request('https://www.animezone.pl/anime/filmy') | ||
|
|
||
| result = client.parseDOM(r, 'div', attrs={'class': 'btn-group btn-group-xs'}) | ||
| linki_litery = client.parseDOM(result, 'a', ret='href') | ||
| litery = client.parseDOM(result, 'a') | ||
| counter = 0 | ||
| for link in linki_litery: | ||
| link = url + link | ||
| addon.addDir(str(litery[counter]), link, mode=3) | ||
| counter += 1 | ||
|
|
||
| def ListowanieAnime(): | ||
| url = params['url'] | ||
|
|
@@ -321,6 +335,9 @@ def OdpalanieLinku(): | |
| elif mode == 10: | ||
| Alfabetycznie() | ||
|
|
||
| elif mode == 15: | ||
| Alfabetyczniefilmy() | ||
|
|
||
| elif mode == 20: | ||
| addon.addDir("Typ widowni", '', mode=21) | ||
| addon.addDir("Gatunek", '', mode=22) | ||
|
|
@@ -331,17 +348,17 @@ def OdpalanieLinku(): | |
| Gatunki('http://www.animezone.pl/gatunki?type=', 0) | ||
|
|
||
| elif mode == 22: | ||
| Gatunki('http://www.animezone.pl/gatunki?species=', 1) | ||
| Gatunki('http://www.animezone.pl/gatunki?species[]=', 1) | ||
|
|
||
| elif mode == 23: | ||
| Gatunki('http://www.animezone.pl/gatunki?topic=', 2) | ||
| Gatunki('http://www.animezone.pl/gatunki?topic[]=', 2) | ||
|
|
||
| elif mode == 24: | ||
| Gatunki('http://www.animezone.pl/gatunki?years=', 3) | ||
|
|
||
| elif mode == 30: | ||
| counter = 1982 | ||
| while counter <= 2019: | ||
| counter = 2019 | ||
| while counter > 1982: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @po50on, Tutaj pytanie, poprzednio było od 1982 do 2019 (włącznie). while counter >= 1982:
...albo w mojej propozycji (drugi parametr xrange() i range() czyli koniec zakresu zawsze nie wchodzi): for counter in xrange(2019, 1981, -1):
...
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. twoja propozycja mi sie podoba
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. można jeszcze 2019 zamienić na:
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Jak to jest rok, to jasne. Nawet import datetime.date
datetime.date.today().year + 1 |
||
| addon.addDir("Sezon Wiosna " + str(counter), 'http://www.animezone.pl/anime/sezony/' + str(counter) + '/wiosna', | ||
| mode=3) | ||
| addon.addDir("Sezon Lato " + str(counter), 'http://www.animezone.pl/anime/sezony/' + str(counter) + '/lato', | ||
|
|
@@ -350,7 +367,7 @@ def OdpalanieLinku(): | |
| mode=3) | ||
| addon.addDir("Sezon Zima " + str(counter), 'http://www.animezone.pl/anime/sezony/' + str(counter) + '/zima', | ||
| mode=3) | ||
| counter += 1 | ||
| counter = counter - 1 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To już poproszę na wzór oryginału, nieco bardziej czytelne czyli: counter -= 1 |
||
|
|
||
| elif mode == 40: | ||
| addon.addDir("Ranking ocen", 'http://www.animezone.pl/anime/ranking/ocen', mode=41) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jako ciekawostkę, bo nie wymagam zmiany (było też tak sobie), podaję alternatywę:
Wtedy już by nie było odejmowania
counterna końcu.