Only operate on sources of http code 200

What potentially could happen, is removing all news items of a 403 feed, which would cause in resending all of its news items, including those that were already seen by user.
This commit is contained in:
Schimon Jehudah 2022-11-23 14:31:59 +00:00
parent 52fad12660
commit 10735697ce

View file

@ -1,5 +1,11 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vars and their meanings:
# cur = Cursor (SQL)
# jid = Jabber ID (XMPP)
# res = response (HTTP)
import os import os
from argparse import ArgumentParser from argparse import ArgumentParser
from asyncio.exceptions import IncompleteReadError from asyncio.exceptions import IncompleteReadError
@ -167,7 +173,7 @@ def print_help():
msg = ("Slixfeed - News syndication bot for Jabber/XMPP \n" msg = ("Slixfeed - News syndication bot for Jabber/XMPP \n"
"\n" "\n"
"DESCRIPTION: \n" "DESCRIPTION: \n"
" Slixfeed is an aggregator bot for online news feeds. \n" " Slixfeed is a news aggregator bot for online news feeds. \n"
"\n" "\n"
"BASIC USAGE: \n" "BASIC USAGE: \n"
" enable \n" " enable \n"
@ -179,7 +185,7 @@ def print_help():
"\n" "\n"
"EDIT OPTIONS: \n" "EDIT OPTIONS: \n"
" feed add URL \n" " feed add URL \n"
" Add URL to the subscriptions list. \n" " Add URL to subscription list. \n"
" feed remove ID \n" " feed remove ID \n"
" Remove feed from subscription list. \n" " Remove feed from subscription list. \n"
" feed status ID \n" " feed status ID \n"
@ -191,6 +197,16 @@ def print_help():
" feed recent N \n" " feed recent N \n"
" List recent N news items (up to 50 items). \n" " List recent N news items (up to 50 items). \n"
"\n" "\n"
"BACKUP OPTIONS: \n"
" export opml \n"
" Send an OPML file with your feeds. \n"
" backup news html\n"
" Send an HTML formatted file of your news items. \n"
" backup news md \n"
" Send a Markdown file of your news items. \n"
" backup news text \n"
" Send a Plain Text file of your news items. \n"
"\n"
"DOCUMENTATION: \n" "DOCUMENTATION: \n"
" Slixfeed \n" " Slixfeed \n"
" https://gitgud.io/sjehuda/slixfeed \n" " https://gitgud.io/sjehuda/slixfeed \n"
@ -327,6 +343,12 @@ async def download_updates(db_file):
print(e) print(e)
return return
# TODO Place these couple of lines back down # TODO Place these couple of lines back down
# NOTE Need to correct the SQL statement to do so
# NOT SURE WHETHER I MEANT THE LINES ABOVE OR BELOW
if res[1] == 200:
# NOT SURE WHETHER I MEANT THE LINES ABOVE OR BELOW
# TODO Place these couple of lines back down
# NOTE Need to correct the SQL statement to do so # NOTE Need to correct the SQL statement to do so
entries = feed.entries entries = feed.entries
length = len(entries) length = len(entries)