mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-12 21:28:29 +03:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8624e9f177 | ||
|
|
381940f5a8 | ||
|
|
1382f8b795 | ||
|
|
fac8364762 | ||
|
|
0feeb0bd24 | ||
|
|
ddb9dc87d7 |
1528
Pipfile.lock
generated
1528
Pipfile.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,8 @@ TAG=$(python -c 'from src.auto_archiver.version import __version__; print("v" +
|
|||||||
read -p "Creating new release for $TAG. Do you want to continue? [Y/n] " prompt
|
read -p "Creating new release for $TAG. Do you want to continue? [Y/n] " prompt
|
||||||
|
|
||||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||||
git add -A
|
# git add -A
|
||||||
git commit -m "Bump version to $TAG for release" || true && git push
|
# git commit -m "Bump version to $TAG for release" || true && git push
|
||||||
echo "Creating new git tag $TAG"
|
echo "Creating new git tag $TAG"
|
||||||
git tag "$TAG" -m "$TAG"
|
git tag "$TAG" -m "$TAG"
|
||||||
git push --tags
|
git push --tags
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ class TwitterArchiver(Archiver):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
name = "twitter_archiver"
|
name = "twitter_archiver"
|
||||||
link_pattern = re.compile(r"twitter.com\/(?:\#!\/)?(\w+)\/status(?:es)?\/(\d+)")
|
link_pattern = re.compile(r"(?:twitter|x).com\/(?:\#!\/)?(\w+)\/status(?:es)?\/(\d+)")
|
||||||
link_clean_pattern = re.compile(r"(.+twitter\.com\/.+\/\d+)(\?)*.*")
|
link_clean_pattern = re.compile(r"(.+(?:twitter|x)\.com\/.+\/\d+)(\?)*.*")
|
||||||
|
|
||||||
def __init__(self, config: dict) -> None:
|
def __init__(self, config: dict) -> None:
|
||||||
super().__init__(config)
|
super().__init__(config)
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ class GDriveStorage(Storage):
|
|||||||
'parents': [upload_to]
|
'parents': [upload_to]
|
||||||
}
|
}
|
||||||
media = MediaFileUpload(media.filename, resumable=True)
|
media = MediaFileUpload(media.filename, resumable=True)
|
||||||
gd_file = self.service.files().create(body=file_metadata, media_body=media, fields='id').execute()
|
gd_file = self.service.files().create(supportsAllDrives=True, body=file_metadata, media_body=media, fields='id').execute()
|
||||||
logger.debug(f'uploadf: uploaded file {gd_file["id"]} successfully in folder={upload_to}')
|
logger.debug(f'uploadf: uploaded file {gd_file["id"]} successfully in folder={upload_to}')
|
||||||
|
|
||||||
# must be implemented even if unused
|
# must be implemented even if unused
|
||||||
@@ -150,6 +150,9 @@ class GDriveStorage(Storage):
|
|||||||
|
|
||||||
for attempt in range(retries):
|
for attempt in range(retries):
|
||||||
results = self.service.files().list(
|
results = self.service.files().list(
|
||||||
|
# both below for Google Shared Drives
|
||||||
|
supportsAllDrives=True,
|
||||||
|
includeItemsFromAllDrives=True,
|
||||||
q=query_string,
|
q=query_string,
|
||||||
spaces='drive', # ie not appDataFolder or photos
|
spaces='drive', # ie not appDataFolder or photos
|
||||||
fields='files(id, name)'
|
fields='files(id, name)'
|
||||||
@@ -182,7 +185,7 @@ class GDriveStorage(Storage):
|
|||||||
'mimeType': 'application/vnd.google-apps.folder',
|
'mimeType': 'application/vnd.google-apps.folder',
|
||||||
'parents': [parent_id]
|
'parents': [parent_id]
|
||||||
}
|
}
|
||||||
gd_folder = self.service.files().create(body=file_metadata, fields='id').execute()
|
gd_folder = self.service.files().create(supportsAllDrives=True, body=file_metadata, fields='id').execute()
|
||||||
return gd_folder.get('id')
|
return gd_folder.get('id')
|
||||||
|
|
||||||
# def exists(self, key):
|
# def exists(self, key):
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ class UrlUtil:
|
|||||||
if "vk.com/images/" in url: return False
|
if "vk.com/images/" in url: return False
|
||||||
if "vk.com/images/reaction/" in url: return False
|
if "vk.com/images/reaction/" in url: return False
|
||||||
|
|
||||||
|
# wikipedia
|
||||||
|
if "wikipedia.org/static" in url: return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class Webdriver:
|
|||||||
|
|
||||||
def __enter__(self) -> webdriver:
|
def __enter__(self) -> webdriver:
|
||||||
options = webdriver.FirefoxOptions()
|
options = webdriver.FirefoxOptions()
|
||||||
options.headless = True
|
options.add_argument("--headless")
|
||||||
options.set_preference('network.protocol-handler.external.tg', False)
|
options.set_preference('network.protocol-handler.external.tg', False)
|
||||||
try:
|
try:
|
||||||
self.driver = webdriver.Firefox(options=options)
|
self.driver = webdriver.Firefox(options=options)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
_MAJOR = "0"
|
_MAJOR = "0"
|
||||||
_MINOR = "6"
|
_MINOR = "7"
|
||||||
# On main and in a nightly release the patch should be one ahead of the last
|
# On main and in a nightly release the patch should be one ahead of the last
|
||||||
# released build.
|
# released build.
|
||||||
_PATCH = "11"
|
_PATCH = "1"
|
||||||
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
|
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
|
||||||
# https://semver.org/#is-v123-a-semantic-version for the semantics.
|
# https://semver.org/#is-v123-a-semantic-version for the semantics.
|
||||||
_SUFFIX = ""
|
_SUFFIX = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user