Gogoanime Default DL Host Fix (#253)

* 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
master
andrewlef 2019-10-23 04:20:30 -04:00 committed by Vishnunarayan K I
parent 82a762ec02
commit 6d05b78411
2 changed files with 31 additions and 3 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -1,4 +1,5 @@
import logging
import re
from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers
@ -10,15 +11,40 @@ 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
@ -26,10 +52,12 @@ class GogoanimeEpisode(AnimeEpisode, sitename='gogoanime'):
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'