Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Cecylia Bocovich
gettor
Commits
7ca38d2f
Unverified
Commit
7ca38d2f
authored
Aug 01, 2019
by
Philipp Winter
Browse files
Fetch latest Tor Browser version from JSON.
This fixes <
https://bugs.torproject.org/31313
>.
parent
cfe2a518
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/add_links_to_db
View file @
7ca38d2f
...
...
@@ -10,10 +10,13 @@
import
os
import
sys
import
json
import
sqlite3
import
argparse
from
urllib
import
request
TOR_BROWSER_DOWNLOADS
=
"https://aus1.torproject.org/torbrowser/update_3/release/downloads.json"
def
print_header
():
header
=
"""
__ __
...
...
@@ -53,9 +56,13 @@ def main():
args
=
parser
.
parse_args
()
abs_filename
=
os
.
path
.
abspath
(
args
.
filename
)
webFile
=
request
.
urlopen
(
"https://www.torproject.org/projects/torbrowser/RecommendedTBBVersions/"
)
versions
=
webFile
.
read
().
decode
(
'utf-8'
).
translate
({
ord
(
c
):
None
for
c
in
'[]
\n
" '
})
version
=
versions
.
split
(
","
)[
-
12
]
webFile
=
request
.
urlopen
(
TOR_BROWSER_DOWNLOADS
)
content
=
webFile
.
read
()
jsonObj
=
json
.
loads
(
content
)
version
=
jsonObj
.
get
(
"version"
,
None
)
if
version
is
None
:
print
(
"Could not fetch version from {}."
.
format
(
TOR_BROWSER_DOWNLOADS
))
sys
.
exit
(
1
)
providers
=
{
"gitlab"
:
"https://gitlab.com/thetorproject/gettorbrowser/raw/releases/"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment