Skip to content

Commit

Permalink
Gogoanime Default DL Host Fix (#253)
Browse files Browse the repository at this point in the history
* Gogoanime Default DL Host Fix

Switched download host to gogo default hosting servers (cdnfile).  This should pre-empt the issues experienced with improper mp4upload url encoding and rapidvideo unavailability.  Additionally, it also fixes the problem of low quality selection.  Using the default hoster will always download at original (highest) quality.

As of now, mp4upload and rapidvideo are disabled (commented), but can easily be restored by uncommenting.  I also inserted code for streamango support, though it's currently disabled as well.

Ideally, there should be a way to give the user a choice of hosting service to download from.  I haven't implemented this, as I'm unsure of the best way to do so.  Having an additional prompt for each file isn't exactly ideal.

* Update gogoanime.py

* Update gogoanime.py
  • Loading branch information
andrewlef authored and vn-ki committed Oct 23, 2019
1 parent 82a762e commit 6d05b78
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
Binary file added .DS_Store
Binary file not shown.
34 changes: 31 additions & 3 deletions anime_downloader/sites/gogoanime.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import re

from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers
Expand All @@ -10,26 +11,53 @@ class GogoanimeEpisode(AnimeEpisode, sitename='gogoanime'):
_base_url = 'https://www2.gogoanime.se'

def _get_sources(self):

# Scrape episode page to get link for download page
dl_soup = helpers.soupify(helpers.get(self.url))
dl_page_url = []

for element in dl_soup.find_all('a', href=re.compile('https://vidstreaming\.io')):
source_url = element.get('href')
logger.debug('%s' % (source_url))
dl_page_url = source_url

# Scrape download page for default hoster (cdnfile) file link
soup_cdnfile = helpers.soupify(helpers.get(dl_page_url))
cdnfile_url = []

for element in soup_cdnfile.find_all('a', href=re.compile('https://.*\.cdnfile\.info')):
extractor_class = 'no_extractor'
source_url = element.get('href')
logger.debug('%s: %s' % (extractor_class, source_url))
cdnfile_url.append((extractor_class, source_url,))
return cdnfile_url

'''
soup = helpers.soupify(helpers.get(self.url))
extractors_url = []
for element in soup.select('.anime_muti_link > ul > li'):
extractor_class = element.get('class')[0]
source_url = element.a.get('data-video')
logger.debug('%s: %s' % (extractor_class, source_url))
# prefer streamango, else use mp4upload and rapidvideo as sources
# only use mp4upload and rapidvideo as sources
if extractor_class == 'mp4':
if extractor_class == 'streamango':
extractor_class = 'streamango'
elif extractor_class == 'mp4':
extractor_class = 'mp4upload'
elif extractor_class != 'rapidvideo':
continue
logger.debug('%s: %s' % (extractor_class, source_url))
extractors_url.append((extractor_class, source_url,))
return extractors_url
'''


class GogoAnime(Anime, sitename='gogoanime'):
sitename = 'gogoanime'
QUALITIES = ['360p', '480p', '720p']
QUALITIES = ['360p', '480p', '720p', '1080p']
_episode_list_url = 'https://www2.gogoanime.se//load-list-episode'
_search_api_url = 'https://ajax.apimovie.xyz/site/loadAjaxSearch'

Expand Down

0 comments on commit 6d05b78

Please sign in to comment.