Skip to content

Commit

Permalink
use twarc.ensure_flattened
Browse files Browse the repository at this point in the history
  • Loading branch information
edsu committed May 31, 2021
1 parent 005043a commit e29ff10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='twarc-videos',
version='0.0.5',
version='0.0.6',
url='https://github.com/docnow/twarc-videos',
author='Ed Summers',
author_email='[email protected]',
Expand All @@ -14,7 +14,7 @@
long_description=long_description,
long_description_content_type="text/markdown",
python_requires='>=3.3',
install_requires=['twarc', 'youtube_dl', 'click'],
install_requires=['twarc>=2.1.1', 'youtube_dl', 'click'],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'python-dotenv'],
entry_points='''
Expand Down
4 changes: 2 additions & 2 deletions twarc_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import multiprocessing as mp

from urllib.parse import urlparse
from twarc.expansions import flatten
from twarc import ensure_flattened
from datetime import datetime, timedelta
from youtube_dl.utils import match_filter_func

Expand Down Expand Up @@ -74,7 +74,7 @@ def videos(max_downloads, max_filesize, ignore_livestreams, download_dir, block,
# loop through the tweets
results = open(mapping_file, 'a')
for line in infile:
for tweet in flatten(json.loads(line))['data']:
for tweet in ensure_flattened(json.loads(line)):
log.info('analyzing %s', tweet['id'])
for url in video_urls(tweet):
if url in seen:
Expand Down

0 comments on commit e29ff10

Please sign in to comment.