Skip to content

Commit 48a7162

Browse files
committed
bobbit.modules.feeds: use curl util
1 parent 6b6eb78 commit 48a7162

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/bobbit/modules/feeds.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import feedparser
1414

1515
from bobbit.message import Message
16-
from bobbit.utils import shorten_url, strip_html
16+
from bobbit.utils import curl, shorten_url, strip_html
1717

1818
# Metadata
1919

@@ -49,9 +49,7 @@ async def process_feed(http_client, feed, cache):
4949
feed_content = await response.content.read()
5050
if response.status == 403 and b'Cloudflare' in feed_content:
5151
logging.debug('Workaround Cloudflare with curl...')
52-
command = shlex.split(f'curl -sL {feed_url}')
53-
process = await asyncio.create_subprocess_exec(*command, stdout=asyncio.subprocess.PIPE)
54-
feed_content, _ = await process.communicate()
52+
feed_content = await curl(feed_url)
5553
except aiohttp.client_exceptions.ClientPayloadError as e:
5654
logging.warning('Could not fetch %s: %s', feed_url, e)
5755
return

0 commit comments

Comments
 (0)