Skip to content

Commit

Permalink
Fixing loading bar & title trim for yt channel-links
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Dec 20, 2023
1 parent ee318b5 commit e055d90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion minet/cli/youtube/channel_links.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from minet.cli.utils import with_enricher_and_loading_bar
from minet.cli.loading_bar import LoadingBar
from minet.youtube.scraper import YouTubeScraper


Expand All @@ -9,7 +10,7 @@
sub_unit="links",
nested=True,
)
def action(cli_args, enricher, loading_bar):
def action(cli_args, enricher, loading_bar: LoadingBar):
scraper = YouTubeScraper()

for row, channel_url in enricher.cells(cli_args.column, with_rows=True):
Expand All @@ -21,3 +22,4 @@ def action(cli_args, enricher, loading_bar):

for title, link in links:
enricher.writerow(row, [title, link])
loading_bar.nested_advance()
2 changes: 1 addition & 1 deletion minet/youtube/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def gather_external_links(data) -> Iterator[Tuple[str, str]]:
return

yield (
getpath(v, ("title", "content")),
getpath(v, ("title", "content")).strip(),
infer_redirection(
getpath(
v,
Expand Down

0 comments on commit e055d90

Please sign in to comment.