Skip to content

Commit

Permalink
Merge pull request #15 from dyeray/2023-10-upgrade-deps
Browse files Browse the repository at this point in the history
Upgrade dependencies -fix encoding issue in invidious-
  • Loading branch information
dyeray authored Oct 15, 2023
2 parents cb717c8 + e300b94 commit 8296eee
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import requests
import httpx
from flask import Flask, request, Response, render_template, redirect, stream_with_context

from core.feed import render_feed
Expand Down Expand Up @@ -31,7 +31,7 @@ def download():
options = GlobalOptions(**request.args)
url = PluginFactory.create(options.service, request.args).get_item_url(options.id)
if options.proxy_download:
req = requests.get(url, stream=True)
req = httpx.get(url, stream=True)
return Response(stream_with_context(req.iter_content()), content_type=req.headers['content-type'])
else:
return redirect(url, code=302)
Expand Down
4 changes: 2 additions & 2 deletions plugins/invidious.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from datetime import datetime

import requests
import httpx
from parsel import Selector, SelectorList

from core.model import PodcastItem, PodcastFeed
Expand All @@ -27,7 +27,7 @@ def __init__(self, options: dict[str, str]):
super().__init__({'domain': os.getenv('INVIDIOUS_DOMAIN'), **options})

def get_feed(self, feed_id):
response = requests.get(f"https://{self.options.domain}/feed/{self.options.feed_type}/{feed_id}")
response = httpx.get(f"https://{self.options.domain}/feed/{self.options.feed_type}/{feed_id}")
sel = Selector(response.text)
title = sel.css('feed > title::text').get()
return PodcastFeed(
Expand Down
6 changes: 3 additions & 3 deletions plugins/ivoox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List, Union

import dateparser
import requests
import httpx
from parsel import Selector, SelectorList

from core.model import PodcastFeed, PodcastItem
Expand All @@ -19,7 +19,7 @@ class PluginOptions(Options):
def get_feed(self, feed_id):
"""Calculates and returns the subscribable feed."""
url = f'https://www.ivoox.com/{feed_id}.html'
response = requests.get(url)
response = httpx.get(url)
sel = Selector(response.text)
videos = sel.css('.modulo-type-episodio')
current_page = 1
Expand All @@ -28,7 +28,7 @@ def get_feed(self, feed_id):
next_page_url = sel.css('.pagination li:last-child a::attr(href)').get()
if next_page_url == '#':
break
response = requests.get(next_page_url)
response = httpx.get(next_page_url)
sel = Selector(response.text)
videos.extend(sel.css('.modulo-type-episodio'))
return PodcastFeed(
Expand Down
4 changes: 2 additions & 2 deletions plugins/youtube.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import List

import requests
import httpx
from parsel import Selector, SelectorList
from pytube import YouTube
from pytube.exceptions import PytubeError
Expand All @@ -26,7 +26,7 @@ class PluginOptions(Options):
options: PluginOptions

def get_feed(self, feed_id):
response = requests.get(f"https://www.youtube.com/feeds/videos.xml?channel_id={feed_id}")
response = httpx.get(f"https://www.youtube.com/feeds/videos.xml?channel_id={feed_id}")
sel = Selector(response.text)
entries = sel.css('feed > entry')
title = sel.css("feed > title::text").get()
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pod2gen==1.0.3
yt-dlp==2023.7.6
flask==2.3.3
yt-dlp==2023.10.13
flask==3.0.0
gunicorn==21.2.0
pytube==15.0.0
requests==2.31.0
httpx==0.25.0
parsel==1.8.1
dateparser==1.1.8
pydantic==2.3.0
pydantic==2.4.2

0 comments on commit 8296eee

Please sign in to comment.