Compare commits
No commits in common. "c5ea674db6dd26752e83d2f51f9a11661949fa1b" and "d3e575dd93313ef5e7c9210ddfa83b7ede18f4bf" have entirely different histories.
c5ea674db6
...
d3e575dd93
@ -1,258 +0,0 @@
|
|||||||
Afghanistan
|
|
||||||
Åland Islands
|
|
||||||
Albania
|
|
||||||
Algeria
|
|
||||||
American Samoa
|
|
||||||
Andorra
|
|
||||||
Angola
|
|
||||||
Anguilla
|
|
||||||
Antarctica
|
|
||||||
Antigua and Barbuda
|
|
||||||
Argentina
|
|
||||||
Armenia
|
|
||||||
Aruba
|
|
||||||
Australia
|
|
||||||
Austria
|
|
||||||
Azerbaijan
|
|
||||||
Bahamas
|
|
||||||
Bahrain
|
|
||||||
Bangladesh
|
|
||||||
Barbados
|
|
||||||
Belarus
|
|
||||||
Belgium
|
|
||||||
Belize
|
|
||||||
Benin
|
|
||||||
Bermuda
|
|
||||||
Bhutan
|
|
||||||
Bolivia
|
|
||||||
"Bonaire, Sint Eustatius and Saba"
|
|
||||||
Bosnia and Herzegovina
|
|
||||||
Botswana
|
|
||||||
Bouvet Island
|
|
||||||
Brazil
|
|
||||||
British Indian Ocean Territory
|
|
||||||
British Virgin Islands
|
|
||||||
Brunei Darussalam
|
|
||||||
Bulgaria
|
|
||||||
Burkina Faso
|
|
||||||
Burma
|
|
||||||
Burundi
|
|
||||||
Cambodia
|
|
||||||
Cameroon
|
|
||||||
Canada
|
|
||||||
Cape Verde
|
|
||||||
Cayman Islands
|
|
||||||
Central African Republic
|
|
||||||
Chad
|
|
||||||
Chile
|
|
||||||
China
|
|
||||||
Christmas Island
|
|
||||||
Cocos (Keeling) Islands
|
|
||||||
Colombia
|
|
||||||
Comoros
|
|
||||||
Congo
|
|
||||||
Cook Islands
|
|
||||||
Costa Rica
|
|
||||||
Côte d'Ivoire
|
|
||||||
Croatia
|
|
||||||
Cuba
|
|
||||||
Cyprus
|
|
||||||
Czech Republic
|
|
||||||
Czechoslovakia
|
|
||||||
Democratic Republic of the Congo
|
|
||||||
Denmark
|
|
||||||
Djibouti
|
|
||||||
Dominica
|
|
||||||
Dominican Republic
|
|
||||||
East Germany
|
|
||||||
Ecuador
|
|
||||||
Egypt
|
|
||||||
El Salvador
|
|
||||||
Equatorial Guinea
|
|
||||||
Eritrea
|
|
||||||
Estonia
|
|
||||||
Ethiopia
|
|
||||||
Falkland Islands
|
|
||||||
Faroe Islands
|
|
||||||
Federal Republic of Yugoslavia
|
|
||||||
Federated States of Micronesia
|
|
||||||
Fiji
|
|
||||||
Finland
|
|
||||||
France
|
|
||||||
French Guiana
|
|
||||||
French Polynesia
|
|
||||||
French Southern Territories
|
|
||||||
Gabon
|
|
||||||
Gambia
|
|
||||||
Georgia
|
|
||||||
Germany
|
|
||||||
Ghana
|
|
||||||
Gibraltar
|
|
||||||
Greece
|
|
||||||
Greenland
|
|
||||||
Grenada
|
|
||||||
Guadeloupe
|
|
||||||
Guam
|
|
||||||
Guatemala
|
|
||||||
Guernsey
|
|
||||||
Guinea
|
|
||||||
Guinea-Bissau
|
|
||||||
Guyana
|
|
||||||
Haiti
|
|
||||||
Heard Island and McDonald Islands
|
|
||||||
Holy See (Vatican City State)
|
|
||||||
Honduras
|
|
||||||
Hong Kong
|
|
||||||
Hungary
|
|
||||||
Iceland
|
|
||||||
India
|
|
||||||
Indonesia
|
|
||||||
Iran
|
|
||||||
Iraq
|
|
||||||
Ireland
|
|
||||||
Isle of Man
|
|
||||||
Israel
|
|
||||||
Italy
|
|
||||||
Jamaica
|
|
||||||
Japan
|
|
||||||
Jersey
|
|
||||||
Jordan
|
|
||||||
Kazakhstan
|
|
||||||
Kenya
|
|
||||||
Kiribati
|
|
||||||
Korea
|
|
||||||
Kosovo
|
|
||||||
Kuwait
|
|
||||||
Kyrgyzstan
|
|
||||||
Laos,🇱🇦
|
|
||||||
Latvia,🇱🇻
|
|
||||||
Lebanon,🇱🇧
|
|
||||||
Lesotho,🇱🇸
|
|
||||||
Liberia,🇱🇷
|
|
||||||
Libya,🇱🇾
|
|
||||||
Liechtenstein,🇱🇮
|
|
||||||
Lithuania,🇱🇹
|
|
||||||
Luxembourg,🇱🇺
|
|
||||||
Macao,🇲🇴
|
|
||||||
Madagascar,🇲🇬
|
|
||||||
Malawi,🇲🇼
|
|
||||||
Malaysia,🇲🇾
|
|
||||||
Maldives,🇲🇻
|
|
||||||
Mali,🇲🇱
|
|
||||||
Malta,🇲🇹
|
|
||||||
Marshall Islands,🇲🇭
|
|
||||||
Martinique,🇲🇶
|
|
||||||
Mauritania,🇲🇷
|
|
||||||
Mauritius,🇲🇺
|
|
||||||
Mayotte,🇾🇹
|
|
||||||
Mexico,🇲🇽
|
|
||||||
Moldova,🇲🇩
|
|
||||||
Monaco,🇲🇨
|
|
||||||
Mongolia,🇲🇳
|
|
||||||
Montenegro,🇲🇪
|
|
||||||
Montserrat,🇲🇸
|
|
||||||
Morocco,🇲🇦
|
|
||||||
Mozambique,🇲🇿
|
|
||||||
Myanmar,🇲🇲
|
|
||||||
Namibia,🇳🇦
|
|
||||||
Nauru,🇳🇷
|
|
||||||
Nepal,🇳🇵
|
|
||||||
Netherlands,🇳🇱
|
|
||||||
Netherlands Antilles,🇳🇱
|
|
||||||
New Caledonia,🇳🇨
|
|
||||||
New Zealand,🇳🇿
|
|
||||||
Nicaragua,🇳🇮
|
|
||||||
Niger,🇳🇪
|
|
||||||
Nigeria,🇳🇬
|
|
||||||
Niue,🇳🇺
|
|
||||||
Norfolk Island,🇳🇫
|
|
||||||
North Korea,🇰🇵
|
|
||||||
North Vietnam,🇻🇳
|
|
||||||
Northern Mariana Islands,🇲🇵
|
|
||||||
Norway,🇳🇴
|
|
||||||
Oman,🇴🇲
|
|
||||||
Pakistan,🇵🇰
|
|
||||||
Palau,🇵🇼
|
|
||||||
Palestine,🇵🇸
|
|
||||||
Palestinian Territory,🇵🇸
|
|
||||||
Panama,🇵🇦
|
|
||||||
Papua New Guinea,🇵🇬
|
|
||||||
Paraguay,🇵🇾
|
|
||||||
Peru,🇵🇪
|
|
||||||
Philippines,🇵🇭
|
|
||||||
Poland,🇵🇱
|
|
||||||
Portugal,🇵🇹
|
|
||||||
Pitcairn,🇵🇳
|
|
||||||
Puerto Rico,🇵🇷
|
|
||||||
Qatar,🇶🇦
|
|
||||||
Republic of Macedonia,🇲🇰
|
|
||||||
Réunion,🇷🇪
|
|
||||||
Romania,🇷🇴
|
|
||||||
Russia,🇷🇺
|
|
||||||
Rwanda,🇷🇼
|
|
||||||
Saint Barthélemy,🇧🇱
|
|
||||||
Saint Helena,🇸🇭
|
|
||||||
Saint Kitts and Nevis,🇰🇳
|
|
||||||
Saint Lucia,🇱🇨
|
|
||||||
Saint Martin (French part),🇫🇷
|
|
||||||
Saint Pierre and Miquelon,🇵🇲
|
|
||||||
Saint Vincent and the Grenadines,🇻🇨
|
|
||||||
Samoa,🇼🇸
|
|
||||||
San Marino,🇸🇲
|
|
||||||
Sao Tome and Principe,🇸🇹
|
|
||||||
Saudi Arabia,🇸🇦
|
|
||||||
Senegal,🇸🇳
|
|
||||||
Serbia,🇷🇸
|
|
||||||
Serbia and Montenegro🇷🇸🇲🇪
|
|
||||||
Seychelles,🇸🇨
|
|
||||||
Siam,🇹🇭
|
|
||||||
Sierra Leone,🇸🇱
|
|
||||||
Singapore,🇸🇬
|
|
||||||
Slovakia,🇸🇰
|
|
||||||
Slovenia,🇸🇮
|
|
||||||
Solomon Islands,🇸🇧
|
|
||||||
Somalia,🇸🇴
|
|
||||||
South Africa🇿🇦
|
|
||||||
South Georgia and the South Sandwich Islands,🇬🇸
|
|
||||||
South Korea,🇰🇷
|
|
||||||
Spain,🇪🇸
|
|
||||||
Sri Lanka,🇱🇰
|
|
||||||
Sudan,🇸🇩
|
|
||||||
Suriname,🇸🇷
|
|
||||||
Svalbard and Jan Mayen,🇸🇯
|
|
||||||
Swaziland,🇸🇿
|
|
||||||
Sweden,🇸🇪
|
|
||||||
Switzerland,🇨🇭
|
|
||||||
Syria,🇸🇾
|
|
||||||
Taiwan,🇹🇼
|
|
||||||
Tajikistan,🇹🇯
|
|
||||||
Tanzania,🇹🇿
|
|
||||||
Thailand,🇹🇭
|
|
||||||
Timor-Leste,🇹🇱
|
|
||||||
Togo,🇹🇬
|
|
||||||
Tokelau,🇹🇰
|
|
||||||
Tonga,🇹🇴
|
|
||||||
Trinidad and Tobago,🇹🇹
|
|
||||||
Tunisia,🇹🇳
|
|
||||||
Turkey,🇹🇷
|
|
||||||
Turkmenistan,🇹🇲
|
|
||||||
Turks and Caicos Islands,🇹🇨
|
|
||||||
Tuvalu,🇹🇻
|
|
||||||
U.S. Virgin Islands,🇻🇮
|
|
||||||
Uganda,🇺🇬
|
|
||||||
Ukraine,🇺🇦
|
|
||||||
United Arab Emirates,🇦🇪
|
|
||||||
United Kingdom,🇬🇧
|
|
||||||
United States,🇺🇸
|
|
||||||
United States Minor Outlying Islands,🇺🇲
|
|
||||||
Uruguay,🇺🇾
|
|
||||||
Uzbekistan,🇺🇿
|
|
||||||
Vanuatu,🇻🇺
|
|
||||||
Venezuela,🇻🇪
|
|
||||||
Vietnam,🇻🇳
|
|
||||||
Wallis and Futuna,🇫🇷
|
|
||||||
West Germany,⬅️🇩🇪
|
|
||||||
Western Sahara,🇪🇭
|
|
||||||
Yemen,🇾🇪
|
|
||||||
Zambia,🇿🇲
|
|
||||||
Zimbabwe,🇿🇼
|
|
Can't render this file because it has a wrong number of fields in line 127.
|
@ -7,7 +7,7 @@ from bookstack import Bookstack
|
|||||||
from vcinema_utils import VCinemaUtils
|
from vcinema_utils import VCinemaUtils
|
||||||
|
|
||||||
|
|
||||||
def update_viewings_csv(token_id, token_secret, check_existing=True):
|
def update_viewings_csv_file_from_page(token_id, token_secret):
|
||||||
# Page ID of https://wiki.jacknet.io/books/vcinema/page/csv
|
# Page ID of https://wiki.jacknet.io/books/vcinema/page/csv
|
||||||
page_id = 11
|
page_id = 11
|
||||||
|
|
||||||
@ -17,21 +17,23 @@ def update_viewings_csv(token_id, token_secret, check_existing=True):
|
|||||||
soup = BeautifulSoup(html_page, 'html.parser')
|
soup = BeautifulSoup(html_page, 'html.parser')
|
||||||
csv_data = soup.find("code").text.strip().encode('utf-8')
|
csv_data = soup.find("code").text.strip().encode('utf-8')
|
||||||
|
|
||||||
if check_existing:
|
print("Retrieving existing file")
|
||||||
print("Retrieving existing file")
|
existing_attachment_id = VCinemaUtils.get_viewings_csv_attachment_id(token_id, token_secret)
|
||||||
existing_attachment_id = VCinemaUtils.get_viewings_csv_attachment_id(token_id, token_secret)
|
|
||||||
attachment = Bookstack.get_attachment(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, existing_attachment_id)
|
|
||||||
existing_attachment_hash = hashlib.md5(attachment).hexdigest()
|
|
||||||
page_hash = hashlib.md5(csv_data).hexdigest()
|
|
||||||
|
|
||||||
if not check_existing or page_hash != existing_attachment_hash:
|
attachment = Bookstack.get_attachment(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, existing_attachment_id)
|
||||||
|
|
||||||
|
existing_attachment_hash = hashlib.md5(attachment).hexdigest()
|
||||||
|
|
||||||
|
page_hash = hashlib.md5(csv_data).hexdigest()
|
||||||
|
|
||||||
|
if page_hash != existing_attachment_hash:
|
||||||
print("Updating file")
|
print("Updating file")
|
||||||
# bookstack update file via api doesn't work
|
# bookstack update file via api doesn't work
|
||||||
Bookstack.post_attachment(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, "vcinema.csv", csv_data, page_id)
|
Bookstack.post_attachment(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, "vcinema.csv", csv_data, page_id)
|
||||||
Bookstack.delete_attachment(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, existing_attachment_id)
|
Bookstack.delete_attachment(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, existing_attachment_id)
|
||||||
print("File updated")
|
print("Done")
|
||||||
else:
|
else:
|
||||||
print("File already up-to-date")
|
print("File already up to date")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
@ -41,4 +43,4 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
update_viewings_csv(args.token_id, args.token_secret)
|
update_viewings_csv_file_from_page(args.token_id, args.token_secret)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user