You can now read a live & updated alt.magick archive at:
https://alt-magick.com
Newsgroup posts are saved under the authors name and email,
instead of a subject / thread format with a powerful search format.
NNTP is a very slow protocol. In order to download every post on
alt.magick I had to leave this program running for over 24 hours.
But keeping the archive updated is still very fast.
The python source code will save posts in files in linux format.
You will have to modify this code for windows.
#!/usr/bin/python
# Copyright (c) 2021 Corey White
#
https://github.com/powercrypt/Usenet-Archiving-Tool
#
https://alt-magick.com
# Replace all the '>>' with tabs
import nntplib
import string
import re
s = nntplib.NNTP('server', user='name', password='pass')
resp, count, first, last, name = s.group('group')
print('Group', name, 'has', count, 'articles, range', first, 'to', last)
cnt = int(last)
s.quit()
stop = 0 # When (1) program terminates on duplicate Message-IDs.
while cnt >= int(first):
>> loop = 0
>> while loop == 0:
>>>> try:
>>>>>> s = nntplib.NNTP('server', user='name', password='pass')
>>>>>> resp, count, first, last, name = s.group('group')
>>>>>> resp2, num2, id2, list = s.body(str(cnt))
>>>>>> r, n, id3, headers = s.head(id2)
>>>>>> s.quit()
>>>>>> loop = 1
>>>> except:
>>>>>> cnt = cnt - 1
>> author = "from: "
>> subject = "subject: "
>> date = "date: "
>> id = "message-id: "
>> for check1 in headers:
>>>> field = check1.lower()
>>>> if field.startswith("from: "):
>>>>>> author = check1
>> for check2 in headers:
>>>> field = check2.lower()
>>>> if field.startswith("subject: "):
>>>>>> subject = check2
>> for check3 in headers:
>>>> field = check3.lower()
>>>> if field.startswith("date: "):
>>>>>> date = check3
>> for check4 in headers:
>>>> field = check4.lower()
>>>> if field.startswith("message-id: "):
>>>>>> id = check4
>>>>>> if stop == 1:
>>>>>>>> with open("history.txt", 'a+') as f:
>>>>>>>>>> for lastmessage in f:
>>>>>>>>>>>> if(id == lastmessage.rstrip()):
>>>>>>>>>>>>>> print("Duplicate Article Found.")
>>>>>>>>>>>>>> quit()
>>>>>> history = open("history.txt", 'a+')
>>>>>> history.write("%s\n" % id)
>>>>>> history.close()
>> filename = author[6:]
>> filename = filename.decode('utf-8','ignore').encode("utf-8")
>> filename = filename.replace(r'/', '')
>> filename = ' '.join(filename.split())
>> filename = filename.strip()
>> if filename[0] != "'" and filename[0] != '"':
>>>> filename = '"' + filename + '"'
>> try:
>>>> file = open(filename, 'a+')
>> except:
>>>> continue
>> file.write("### %s\n\n" % str(cnt))
>> file.write("%s\n\n" % author);
>> file.write("%s\n\n" % subject);
>> file.write("%s\n\n" % date);
>> file.write("%s\n\n" % id);
>> for line in list:
>>>> file.write(line[:80])
>>>> file.write("\n")
>> file.write("\n\n")
>> file.close()
>> print("%s" % str(cnt))
>> cnt = cnt - 1
print ("\n Done.")
quit()