Skip to content

Commit

Permalink
linting/stylistic volations
Browse files Browse the repository at this point in the history
  • Loading branch information
nficano committed Jan 8, 2018
1 parent b9f3136 commit df6fcb3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions pytube/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def init(self):
self.player_config_args = self.vid_info
else:
self.player_config_args = extract.get_ytplayer_config(
self.watch_html)['args']
self.watch_html,
)['args']

# https://github.com/nficano/pytube/issues/165
stream_maps = ['url_encoded_fmt_stream_map']
Expand Down Expand Up @@ -152,7 +153,7 @@ def prefetch(self):
watch_url=self.watch_url,
watch_html=self.watch_html,
embed_html=self.embed_html,
age_restricted=self.age_restricted
age_restricted=self.age_restricted,
)
self.vid_info = request.get(self.vid_info_url)
if not self.age_restricted:
Expand Down
12 changes: 8 additions & 4 deletions pytube/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ def eurl(video_id):
return 'https://youtube.googleapis.com/v/{}'.format(video_id)


def video_info_url(video_id, watch_url, watch_html, embed_html,
age_restricted):
def video_info_url(
video_id, watch_url, watch_html, embed_html,
age_restricted,
):
"""Construct the video_info url.
:param str video_id:
Expand Down Expand Up @@ -94,8 +96,10 @@ def video_info_url(video_id, watch_url, watch_html, embed_html,
else:
# I'm not entirely sure what ``t`` represents. Looks to represent a
# boolean.
t = regex_search(r'\W[\'"]?t[\'"]?: ?[\'"](.+?)[\'"]', watch_html,
group=0)
t = regex_search(
r'\W[\'"]?t[\'"]?: ?[\'"](.+?)[\'"]', watch_html,
group=0,
)
params = OrderedDict([
('video_id', video_id),
('el', '$el'),
Expand Down
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ commit = True
tag = True
current_version = 8.0.3
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
serialize =
serialize =
{major}.{minor}.{patch}

[metadata]
Expand All @@ -15,6 +15,5 @@ description-file = README.md

[coverage:run]
source = pytube
omit =
omit =
pytube/compat.py

0 comments on commit df6fcb3

Please sign in to comment.