Skip to content

Commit

Permalink
Merge pull request #30 from Xonshiz/dev
Browse files Browse the repository at this point in the history
Fixed #27 and support for movies
  • Loading branch information
Xonshiz authored Jun 5, 2021
2 parents 6efd207 + 94052f8 commit 0f2d9f7
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ hulusubs_dl/build/*
hulusubs_dl/dist/*
hulusubs_dl/dev_test/*
hulusubs_dl/dev_test/main_test.py
hulusubs_dl/Hulusubs_dl_Error_Log.log
*.log
venv/*
21 changes: 7 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
matrix:
include:
- language: python
python:
- 2.6
dist: trusty
install:
- "pip install -r requirements.txt"
script:
- cd hulusubs_dl
- python __main__.py --version
- cd ..
notifications:
email:
- [email protected]
- language: python
python:
- 2.7
Expand Down Expand Up @@ -64,6 +51,8 @@ matrix:
- cd hulusubs_dl
- python __main__.py --version
- pyinstaller --onefile --hidden-import=queue "__main__.py" -n "hulusubs_dl_linux"
- ls
- ls "dist"
- cd ..
notifications:
email:
Expand Down Expand Up @@ -101,6 +90,8 @@ matrix:
- cd hulusubs_dl
- python __main__.py --version
- pyinstaller --onefile --hidden-import=queue "__main__.py" -n "hulusubs_dl.exe"
- cd dist
- dir -s
- cd ..
notifications:
email:
Expand Down Expand Up @@ -134,7 +125,9 @@ matrix:
script:
- cd hulusubs_dl
- python3 __main__.py --version
- pyinstaller --onefile --hidden-import=queue "__main__.py" -n "hulusubs_dl_osx"
- pyinstaller --onefile --hidden-import=queue "__main__.py" -n "hulusubs_dl_osx"
- ls
- ls "dist"
- export huluVersion=`cat version.txt`
- cd ..
notifications:
Expand Down
4 changes: 3 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
- Fix for #22
- Added Verbose Logging.
- `#22` was still happening. Verified and fixed it.
- Updated TravisCI Configs to do a Github Release.
- Updated TravisCI Configs to do a Github Release.
- Fixed #27
- Added support to download subtitles of "movies".
3 changes: 3 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Make sure you've gone through [`#Prerequisites`](#prerequisite) and have proper
- Copy the "Cookie" value from it. It'll be a very long text value. Copy all of it.
- Paste that cookie value when the hulusubs_dl asks for it.

According to @IRLPinkiePie , when you copy cookies from firefox, it adds an "ellipse" in the cookie. Be watchful of that.
More on that here : [Firefox Cookie Issue](https://github.com/Xonshiz/Hulusubs_dl/issues/25#issuecomment-808623911)

Refer to this screenshot for some clarification:

[![N|Solid](https://i.imgur.com/4Z0KOn4.png)](https://i.imgur.com/4Z0KOn4.png)
Expand Down
4 changes: 3 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
- Fix for #22
- Added Verbose Logging.
- `#22` was still happening. Verified and fixed it.
- Updated TravisCI Configs to do a Github Release.
- Updated TravisCI Configs to do a Github Release.
- Fixed #27
- Added support to download subtitles of "movies".
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Make sure you've gone through [`#Prerequisites`](#prerequisite) and have proper
- Copy the "Cookie" value from it. It'll be a very long text value. Copy all of it.
- Paste that cookie value when the hulusubs_dl asks for it.

According to @IRLPinkiePie , when you copy cookies from firefox, it adds an "ellipse" in the cookie. Be watchful of that.
More on that here : [Firefox Cookie Issue](https://github.com/Xonshiz/Hulusubs_dl/issues/25#issuecomment-808623911)

Refer to this screenshot for some clarification:

[![N|Solid](https://i.imgur.com/4Z0KOn4.png)](https://i.imgur.com/4Z0KOn4.png)
Expand Down
120 changes: 120 additions & 0 deletions hulusubs_dl/Hulusubs_dl_Error_Log.log

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hulusubs_dl/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

__version__ = "2021.01.08.3"
__version__ = "2021.06.05"
10 changes: 7 additions & 3 deletions hulusubs_dl/hulu.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

class Hulu:
def __init__(self, url, cookie_value, language, extension, download_location, proxy):
if "/movie/" in url:
eab_id_matches = str(url).split('/movie/')[-1].split('-')[-5:]
if eab_id_matches:
url = 'https://www.hulu.com/watch/{0}'.format('-'.join(eab_id_matches))
if "/series/" in url:
self.show_link(url, cookie_value, language, extension, download_location, proxy)
elif "/watch/" in url:
Expand Down Expand Up @@ -53,7 +57,7 @@ def episode_link(self, url, cookie_value, language, extension, download_location
video_metadata = dict(hulu_api.get_eab_id_metadata(eab_id, cookie_value, language)).get('items', {})
logging.debug('\n----\nvideo_metadata: {0}\n----\n'.format(video_metadata))
video_metadata = dict(list(video_metadata)[0])
series_name = utils.get_clean_path_name(video_metadata.get('series_name', "No Name Found"))
series_name = utils.get_clean_path_name(video_metadata.get('series_name', video_metadata.get("name", "No Name Found")))
season_number = video_metadata.get('season', "01")
episode_number = video_metadata.get('number', "01")
file_name = '{0} - S{1}E{2} [{3} Sub].{4}'.format(series_name, season_number, episode_number,
Expand Down Expand Up @@ -83,10 +87,10 @@ def episode_link(self, url, cookie_value, language, extension, download_location
return False

def show_link(self, url, cookie_value, language, extension, download_location, proxy=None):
eab_id_matches = re.findall(r'-([0-9A-Za-z]+)', str(url).split('/series/')[-1])
# We need just the EAB_ID, which is typically split via - and is of 5 words from end.
eab_id_matches = str(url).split('/series/')[-1].split('-')[-5:]
logging.debug('eab_id_matches: {0}'.format(eab_id_matches))
if eab_id_matches and len(eab_id_matches) > 1:
eab_id_matches.pop(0)
eab_id = '-'.join(eab_id_matches)
logging.debug('initial eab_id: {0}'.format(eab_id))
series_metadata = {}
Expand Down

0 comments on commit 0f2d9f7

Please sign in to comment.