Skip to content

Commit

Permalink
Merge pull request #9 from wiejakp/v0.4.2
Browse files Browse the repository at this point in the history
V0.4.2
  • Loading branch information
wiejakp authored Dec 26, 2022
2 parents 07c35c1 + 6b17218 commit 2905888
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Python Sitemap Generator

- Version: 0.4.1
- Update: 2021/12/30
- Version: 0.4.2
- Update: 2022/12/26
- Author: Przemek Wiejak @ [email protected]

Python Site Map Generator uses python multi-threaded approach to read all links accessible through the Web site and generate proper sitemap for SEO purposes.
Expand Down
8 changes: 8 additions & 0 deletions changelog.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Date: 2022/12/26
Version: 0.4.2

- Add MIT license (thank you https://github.com/kylebarney)
- Fixed timeout issues throwing URLError and handling exceptions properly

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Date: 2021/12/30
Version: 0.4.1

Expand Down
11 changes: 8 additions & 3 deletions python-sitemap-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sys
from urllib.request import urlopen
from urllib.request import Request
from urllib.error import URLError
from urllib.request import HTTPError
from urllib.parse import urljoin
from urllib.parse import urlparse
Expand All @@ -36,9 +37,9 @@

# adjust to your liking
# keep values low to prevent firewalls blocking you for flooding
MaxThreads = 5
MaxThreads = 20

# DWFINE YOUR URL - CUSTOM URL!
# DEFINE YOUR URL - CUSTOM URL!
InitialURL = 'HTTPS://SOME_URL.TEST/'

InitialURLInfo = urlparse(InitialURL)
Expand Down Expand Up @@ -231,9 +232,13 @@ def run(self):
#var_dump(temp_content)
pass


except URLError as e:
print ('URLError: ', self.obj['url'])
temp_status = 000
pass

except HTTPError as e:
print ('HTTPError: ', self.obj['url'])
temp_status = e.code
pass

Expand Down
Empty file modified screenshot.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2905888

Please sign in to comment.