mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-02 18:36:49 +01:00
aktualizace hudebnibazar
This commit is contained in:
parent
c0e8f919bc
commit
e83235395a
@ -22,7 +22,7 @@ number_of_pages = int(sys.argv[2])
|
|||||||
|
|
||||||
url_base = "https://hudebnibazar.cz"
|
url_base = "https://hudebnibazar.cz"
|
||||||
url = "{}/{}/?is=1&f=&n=vse&r=&i=50&o=datum&ign=on".format(url_base, category)
|
url = "{}/{}/?is=1&f=&n=vse&r=&i=50&o=datum&ign=on".format(url_base, category)
|
||||||
json_feed = '{{"title": "HudebniBazar - {cat}", "items": [{items}]}}'
|
json_feed = '{{"title": "HudebniBazar - {cat}", "version": "https://jsonfeed.org/version/1.1", "items": [{items}]}}'
|
||||||
items = list()
|
items = list()
|
||||||
|
|
||||||
# To avoid TLSv1.2 errors.
|
# To avoid TLSv1.2 errors.
|
||||||
@ -50,7 +50,7 @@ def processListingDate(string_date: str):
|
|||||||
# hour=int(yday.group(1)), minute=int(yday.group(2))
|
# hour=int(yday.group(1)), minute=int(yday.group(2))
|
||||||
# )
|
# )
|
||||||
|
|
||||||
dy = dateparser.parse(string_date, languages=["cs"]).replace(second=0, microsecond=0)
|
dy = dateparser.parse(string_date, languages=["cs"]).replace(microsecond=0)
|
||||||
local = pytz.timezone("Europe/Prague")
|
local = pytz.timezone("Europe/Prague")
|
||||||
return local.localize(dy).astimezone(pytz.utc)
|
return local.localize(dy).astimezone(pytz.utc)
|
||||||
|
|
||||||
@ -70,7 +70,11 @@ def processListingImgs(listing: bs4.Tag):
|
|||||||
|
|
||||||
|
|
||||||
def generateListingJson(listing: bs4.Tag):
|
def generateListingJson(listing: bs4.Tag):
|
||||||
article_price = listing.find(class_="InzeratCena").contents[0].get_text(strip=True)
|
try:
|
||||||
|
article_price = listing.find(class_="InzeratCena").contents[0].get_text(strip=True)
|
||||||
|
except:
|
||||||
|
article_price = "dohoda"
|
||||||
|
|
||||||
article_title = listing.find(class_="InzeratNadpis").b.get_text(strip=True)
|
article_title = listing.find(class_="InzeratNadpis").b.get_text(strip=True)
|
||||||
article_date = listing.find(class_="InzeratZarazeno").get_text(strip=True)
|
article_date = listing.find(class_="InzeratZarazeno").get_text(strip=True)
|
||||||
|
|
||||||
|
@ -273,15 +273,6 @@ void FeedReader::pauseUnpaseFeedFetching(bool pause) {
|
|||||||
qApp->settings()->setValue(GROUP(Feeds), Feeds::PauseFeedFetching, pause);
|
qApp->settings()->setValue(GROUP(Feeds), Feeds::PauseFeedFetching, pause);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedReader::warnAboutPausedFetching() const {
|
|
||||||
if (m_feedFetchingPaused) {
|
|
||||||
qApp->showGuiMessage(Notification::Event::GeneralEvent,
|
|
||||||
GuiMessage(tr("Feed fetching is paused"),
|
|
||||||
tr("Automatic feed fetching based on time interval is currently paused."),
|
|
||||||
QSystemTrayIcon::MessageIcon::Warning));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FeedReader::isFeedUpdateRunning() const {
|
bool FeedReader::isFeedUpdateRunning() const {
|
||||||
return m_feedDownloader != nullptr && m_feedDownloader->isUpdateRunning();
|
return m_feedDownloader != nullptr && m_feedDownloader->isUpdateRunning();
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,6 @@ class RSSGUARD_DLLSPEC FeedReader : public QObject {
|
|||||||
FeedsProxyModel* feedsProxyModel() const;
|
FeedsProxyModel* feedsProxyModel() const;
|
||||||
MessagesProxyModel* messagesProxyModel() const;
|
MessagesProxyModel* messagesProxyModel() const;
|
||||||
|
|
||||||
void warnAboutPausedFetching() const;
|
|
||||||
|
|
||||||
// Update feeds in extra thread.
|
// Update feeds in extra thread.
|
||||||
void updateFeeds(const QList<Feed*>& feeds, bool update_switched_off_too = false);
|
void updateFeeds(const QList<Feed*>& feeds, bool update_switched_off_too = false);
|
||||||
|
|
||||||
|
@ -127,7 +127,6 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
qApp->loadDynamicShortcuts();
|
qApp->loadDynamicShortcuts();
|
||||||
qApp->hideOrShowMainForm();
|
qApp->hideOrShowMainForm();
|
||||||
qApp->feedReader()->warnAboutPausedFetching();
|
|
||||||
qApp->feedReader()->loadSavedMessageFilters();
|
qApp->feedReader()->loadSavedMessageFilters();
|
||||||
qApp->feedReader()->feedsModel()->loadActivatedServiceAccounts();
|
qApp->feedReader()->feedsModel()->loadActivatedServiceAccounts();
|
||||||
qApp->showTrayIcon();
|
qApp->showTrayIcon();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user