Giter Site home page Giter Site logo

mobeigi / fb2cal Goto Github PK

View Code? Open in Web Editor NEW
418.0 13.0 71.0 226 KB

Fetch Facebook Birthdays events and create an ICS file for use with calendar apps

Home Page: https://go.mobeigi.com/fb2cal

License: GNU General Public License v3.0

Python 100.00%
facebook birthdays birthday-reminder ics calendar google-calendar google-drive export events birthday

fb2cal's Introduction


fb2cal

Facebook Birthday Events to ICS file converter


Description

Around 20 June 2019, Facebook removed their Facebook Birthday ICS export option.
This change was unannounced and no reason was ever released.

fb2cal is a tool which restores this functionality.
It works by calling endpoints that power the https://www.facebook.com/events/birthdays/ page.
After gathering a list of birthdays for all the users friends for a full year, it creates a ICS calendar file. This ICS file can then be imported into third party tools (such as Google Calendar or Apple Calendar).

Caveats

  • Facebook accounts secured with 2FA are currently not supported (see #9)
  • During Facebook authentication, a security checkpoint may trigger that will force you to change your Facebook password.

Requirements

  • Facebook account
  • Python 3.9+
  • pipenv
  • Scheduler tool to automatically run script periodically (optional)

PyPi Project

https://pypi.org/project/fb2cal/

Instructions

PyPi (Recommended)

  1. In an empty folder of your choice, set up pipenv environment
    pipenv install
  2. Install fb2cal module:
    pipenv run pip install fb2cal
  3. Download config/config-template.ini file and store it in config/config.ini.
  4. Update the config/config.ini file and enter your Facebook email and password (no quotes).
  5. Run the fb2cal module
    pipenv run python -m fb2cal
  6. Check the output folder (out by default) for the created birthdays.ics file

Local

  1. Clone repo
    git clone [email protected]:mobeigi/fb2cal.git
  2. Copy config/config-template.ini to config/config.ini.
  3. Update the config/config.ini file and enter your Facebook email and password (no quotes).
  4. Set up pipenv environment
    pipenv install
  5. Run the fb2cal module
    pipenv run python -m fb2cal
  6. Check the output folder (out by default) for the created birthdays.ics file

Configuration

This tool can be configured by editing the config/config.ini configuration file.

Section Key Valid Values Description
AUTHfb_emailYour Facebook login email
fb_passwordYour Facebook login password
FILESYSTEMsave_to_fileTrue, FalseIf tool should save ICS file to the local file system
ics_file_pathPath to save ICS file to (including file name)
LOGGINGlevelDEBUG, INFO, WARNING, ERROR, CRITICALLogging level to use. Default: INFO

Scheduled Task Frequency

It is recommended to run the script once every 24 hours to update the ICS file to ensure it is synchronized with the latest Facebook changes (due to friend addition/removal) and to respect the privacy of users who decide to hide their birthday later on. Facebook originally recommended polling for birthday updates once every 12 hours based on the X-PUBLISHED-TTL:PT12H header included in their ICS files.

Testing

  1. Set up pipenv environment
    pipenv install
  2. Install the fb2cal module
    pipenv run python -m pip install .
  3. Run the unittests module on the tests folder
    pipenv run python -m unittest discover tests

Troubleshooting

If you encounter any issues, please open the config/config.ini configuration file and set the LOGGING level to DEBUG (it is INFO by default). Include these logs when asking for help.

Contributions

Contributions are always welcome! Just make a pull request.

Licence

GNU General Public License v3.0

fb2cal's People

Contributors

aminbeigi avatar awendland avatar bhavul avatar dpasut avatar gogvale avatar isaacna avatar karbassi avatar mobeigi avatar monkler avatar naezeroth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fb2cal's Issues

Add Language Translations for Day Names for non-English locales

See #11 for context.

All non-English locales need day name translations to properly work out the close/relative dates.

Possible approaches:

  • Hardcode all translations for every non-English locale
  • Use Google Translate API to translate everything to English and proceed to use English names for checks

Stuck after running src/fb2cal.py

Here is the error:

Jias-MBP:fb2cal-master jiawen$ python3 src/fb2cal.py
[2019-08-26 21:00:52,728] fb2cal INFO () Starting fb2cal v1.0.3 (Production) [https://git.io/fjMwr]
[2019-08-26 21:00:52,728] fb2cal INFO () This project is released under the GPLv3 license.
[2019-08-26 21:00:52,728] fb2cal INFO (main) Attemping to parse config file config.ini...
[2019-08-26 21:00:52,729] fb2cal INFO (main) Config successfully loaded.
[2019-08-26 21:00:52,729] fb2cal INFO (main) Logging level set to: INFO
[2019-08-26 21:00:52,729] fb2cal INFO (main) Authenticating with Google Drive API...
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access token.json: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Traceback (most recent call last):
File "src/fb2cal.py", line 813, in
main()
File "src/fb2cal.py", line 102, in main
service = google_drive_api_authenticate()
File "src/fb2cal.py", line 275, in google_drive_api_authenticate
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/oauth2client/client.py", line 2135, in flow_from_clientsecrets
cache=cache)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 165, in loadfile
return _loadfile(filename)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 126, in _loadfile
return _validate_clientsecrets(obj)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 101, in _validate_clientsecrets
prop_name, client_type))
oauth2client.clientsecrets.InvalidClientSecretsError: Missing property "redirect_uris" in a client type of "web".

Issue with parsing Birthday date

I was trying to use the script but it's failing because of the error -

ValueError: month must be in 1..12

I added a line to print birthday.month and birthday.day. The birthday month is being parsed as 13 and day as 7.
Going into that user's about page the Birthday shows as 13 July 1996.
I am from India and we use DD/MM format for dates.

If any other is info is required please let me know.

Config.ini rename error

I had renamed the config file, yet getting this error

[2019-08-19 13:30:32,196] fb2cal INFO () Starting fb2cal v1.0.2 (Production) [https://git.io/fjMwr]
[2019-08-19 13:30:32,198] fb2cal INFO () This project is released under the GPLv3 license.
[2019-08-19 13:30:32,199] fb2cal INFO (main) Attemping to parse config file config.ini...
[2019-08-19 13:30:32,205] fb2cal ERROR (main) ../config/config.ini does not exist. Please rename config-template.ini if you have not done so already.
[2019-08-19 13:30:32,206] fb2cal CRITICAL () Critical error encountered. Terminating.

Use Manual password method for Facebook

Please make a manual password method available through the script for storagless password entry.

Alternatively you can use "pass" or Hashicorp Vault to store passwords, and have a key to unlock during operation.

KeyError: 'domops'

[2019-08-12 14:51:00,396] fb2cal INFO (main) Fetching all Birthdays via async endpoint...
[2019-08-12 14:51:04,866] fb2cal INFO (get_async_birthdays) Processing birthdays for month August.
[2019-08-12 14:51:07,053] fb2cal ERROR (parse_birthday_async_output) KeyError: 'domops'
Traceback (most recent call last):
File "./fb2cal.py", line 437, in parse_birthday_async_output
birthday_card_html = json_response['domops'][0][3]['__html']
KeyError: 'domops'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./fb2cal.py", line 770, in
main()
File "./fb2cal.py", line 111, in main
birthdays = get_async_birthdays(browser)
File "./fb2cal.py", line 395, in get_async_birthdays
birthdays_for_month = parse_birthday_async_output(browser, response.text)
File "./fb2cal.py", line 445, in parse_birthday_async_output
raise SystemError
SystemError

Handle Cyrillic letter names

When I run the application and have people who's names contain Cyrillic letters, the following data gets saved in the .ics file

SUMMARY:&#x41d\;&#x438\;&#x43d\;&#x430\; &#x41f\;&#x435\;&#x442\;&#x440\;&#x43e\;&#x432\;&#x430\;'s Birthday

And the same text is displayed later on in the actual calendar.

Shouldn't the saved names be encoded in UTF-8 ?

PS: Thanks for this product very, very much 😄

Grab year of birth

Hey, first of all thank you for your script. It would be nice to have the year of birth as well (if provided by user).

I myself would love a CSV output like
userid,username,birthdate,year_of_birth rather than a ics file which outdates the next year, but thats just me.

configparser.InterpolationSyntaxError: '%' must be followed by '%'

Was following the youtube video for windows ( thanks for doing that btw ) . but i'm getting this issue.

File "src/fb2cal.py", line 812, in
File "src/fb2cal.py", line 110, in main
File "C:\Users\chris\AppData\Local\Programs\Python\Python37-32\lib\configparser.py", line 1252, in getitem
return self._parser.get(self._name, key)
File "C:\Users\chris\AppData\Local\Programs\Python\Python37-32\lib\configparser.py", line 799, in get
d)
File "C:\Users\chris\AppData\Local\Programs\Python\Python37-32\lib\configparser.py", line 394, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "C:\Users\chris\AppData\Local\Programs\Python\Python37-32\lib\configparser.py", line 444, in _interpolate_some
"found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%****'

KeyError: 'vertical_type'

At the end of going through all my friends (3k), no file is generated and this is the output. I attempted both storing the file to drive and to local with no success. Any ideas?

Traceback (most recent call last):
  File "src/fb2cal.py", line 814, in <module>
  File "src/fb2cal.py", line 117, in main
  File "src/fb2cal.py", line 401, in get_async_birthdays
  File "src/fb2cal.py", line 460, in parse_birthday_async_output
  File "src/fb2cal.py", line 699, in get_entity_id_from_vanity_name
KeyError: 'vertical_type'

I think it may be because of too many requests. Is there a way to split up and do smaller batches perhaps?

Add one-click installation support for non-devs

A lot of non-dev users have trouble setting this script up.
For such people, a one-click solution would be ideal.

Rough outline of what tool would do:

  1. Install script (maybe using PyInstaller to strip away python dependency)
  2. Prompt user for required information (FB user/pass and ICS name)
  3. Automatically add task to cronjob/Task Scheduler/Automater based on OS.

AttributeError: 'Calendar' object has no attribute '_unused'

After successfully processing (All months):
get the following error:

Traceback (most recent call last):
File "SRC./fb2cal.py", line 813, in
File "SRC./fb2cal.py", line 126, in main
File "SRC./fb2cal.py", line 782, in populate_birthdays_calendar
AttributeError: 'Calendar' object has no attribute '_unused'

No ICS file is created. (Tried creating both local files as well as google drive)

Not sure whats going on! Can someone help?

Cannot fetch birthdays next week

I wasn't able to download the birthdays of the next week because them are written like "monday" and not like "day/month".

The workaround was to replace the 'weekday name' with 'day/month'.
My FB locale is italian so I replaced sabato (Saturday) with 10/8, domenica (Sunday) with 11/8 and so on.

I added the following dates at line 608, before parsed_date = datetime.strptime(birthday_date_str, locale_date_format_mapping[user_locale])

Here is the code, simple but working:

        if birthday_date_str == 'sabato':
            birthday_date_str = '10/8'
        if birthday_date_str == 'domenica':
            birthday_date_str = '11/8'
        if birthday_date_str == 'luned&#xec;':
            birthday_date_str = '12/8'
        if birthday_date_str == 'marted&#xec;':
            birthday_date_str = '13/8'
        if birthday_date_str == 'mercoled&#xec;':
            birthday_date_str = '14/8'
        if birthday_date_str == 'gioved&#xec;':
            birthday_date_str = '15/8'
        if birthday_date_str == 'venerd&#xec;':
            birthday_date_str = '16/8'```

WARNING (get_entity_id_from_vanity_name) Falling back to getting entity id from profile page for vanity name

Script worked really well (on a Mac) when i ran it first time for my profile then tried running it again for my girlfriends.

Script ran rapidly through the first 6 months then suddenly slowed right down and displayed the following message for every name:

"fb2cal WARNING (get_entity_id_from_vanity_name) Falling back to getting entity id from profile page for vanity name example.name. This method is significantly slower."

Seems strange that it was fine for mine and also the first 6 months of hers?

Past & Future Facebook Events

Are there any plans for adding support for past and future Facebook events? I can export future events but not any events from the past - would be a neat feature!

Failed to authenticate with Facebook

Script runs successfully, authentication flow completes.

But no ics file is created, "Failed to authenticate with Facebook. Please check provided email/password"

Had 2FA on, but turned it off. Same error occurs. Triple checked login info, and login info is correct.

Followed every step and stuck here

config file setup, google drive setup and all requirements downloaded.
When I run the .py file I get this error:

python ./fb2cal.py
File "./fb2cal.py", line 51
return f'{self.name} ({self.day}/{self.month})'
^
SyntaxError: invalid syntax

Add logging to stdout and logfile

Nice thing to show progress as script is running.
Also useful for those who want to output/append stdout to a log file every time they run the script.

Improve Performance of script

Example run with account with 581 friends (but only processing 386 with linked Facebook birthday).

[Running] python3 -u "F:\Google Drive\Git\Github\mobeigi\fb2cal\src\fb2cal.py"

[Done] exited with code=0 in 158.374 second

Need to profile script and make improvements.
Unfortunately need to make request per friend which seems to be the bulk of the processing time.

Birthday list is empty

I was getting that domops error so I changed all www.facebook.com to web.facebook.com
I still cannot get it to work. It doesn't find any birthday on my list.

[2019-09-21 23:56:43,703] fb2cal INFO () Starting fb2cal v1.0.3 (Production) [https://git.io/fjMwr]
[2019-09-21 23:56:43,703] fb2cal INFO () This project is released under the GPLv3 license.
[2019-09-21 23:56:43,704] fb2cal INFO (main) Attemping to parse config file config.ini...
[2019-09-21 23:56:43,705] fb2cal INFO (main) Config successfully loaded.
[2019-09-21 23:56:43,706] fb2cal INFO (main) Logging level set to: INFO
[2019-09-21 23:56:43,706] fb2cal INFO (main) Attemping to authenticate with Facebook...
[2019-09-21 23:56:48,353] fb2cal INFO (main) Successfully authenticated with Facebook.
[2019-09-21 23:56:48,353] fb2cal INFO (main) Fetching all Birthdays via async endpoint...
[2019-09-21 23:56:48,355] fb2cal INFO (get_async_birthdays) Processing birthdays for month September.
[2019-09-21 23:56:51,013] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month September.
[2019-09-21 23:56:51,013] fb2cal INFO (get_async_birthdays) Processing birthdays for month October.
[2019-09-21 23:56:51,359] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month October.
[2019-09-21 23:56:51,360] fb2cal INFO (get_async_birthdays) Processing birthdays for month November.
[2019-09-21 23:56:51,665] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month November.
[2019-09-21 23:56:51,665] fb2cal INFO (get_async_birthdays) Processing birthdays for month December.
[2019-09-21 23:56:51,974] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month December.
[2019-09-21 23:56:51,975] fb2cal INFO (get_async_birthdays) Processing birthdays for month January.
[2019-09-21 23:56:52,296] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month January.
[2019-09-21 23:56:52,296] fb2cal INFO (get_async_birthdays) Processing birthdays for month February.
[2019-09-21 23:56:52,582] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month February.
[2019-09-21 23:56:52,582] fb2cal INFO (get_async_birthdays) Processing birthdays for month March.
[2019-09-21 23:56:52,902] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month March.
[2019-09-21 23:56:52,902] fb2cal INFO (get_async_birthdays) Processing birthdays for month April.
[2019-09-21 23:56:53,191] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month April.
[2019-09-21 23:56:53,192] fb2cal INFO (get_async_birthdays) Processing birthdays for month May.
[2019-09-21 23:56:53,509] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month May.
[2019-09-21 23:56:53,509] fb2cal INFO (get_async_birthdays) Processing birthdays for month June.
[2019-09-21 23:56:53,809] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month June.
[2019-09-21 23:56:53,809] fb2cal INFO (get_async_birthdays) Processing birthdays for month July.
[2019-09-21 23:56:54,120] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month July.
[2019-09-21 23:56:54,120] fb2cal INFO (get_async_birthdays) Processing birthdays for month August.
[2019-09-21 23:56:54,449] fb2cal INFO (get_async_birthdays) Found 0 birthdays for month August.
[2019-09-21 23:56:54,450] fb2cal WARNING (main) Birthday list is empty. Failed to fetch any birthdays.
Traceback (most recent call last):
File "src/fb2cal.py", line 813, in
File "src/fb2cal.py", line 120, in main
SystemError

29 February Issue.

When the birthday date is the 29 of February the toll will fail with a fail to parse message

[2020-01-05 21:20:36,777] fb2cal ERROR (parse_birthday_day_month) Failed to parse birthday day/month. Parse failed with tooltip_content: " (2/29)", locale: "en_US". Day name "2/29" is not in the offset dict {'monday': 1, 'tuesday': 2, 'wednesday': 3, 'thursday': 4, 'friday': 5, 'saturday': 6, 'sunday': 7}

I'm no good with Python to help you out with this but take a look at
https://stackoverflow.com/questions/44327109/sorting-a-list-of-string-dates-with-no-year-but-with-29th-feb

Keep the good work!

AttributeError: 'Calendar' object has no attribute '_unused'

fb2cal INFO (main) Creating birthday ICS file...
Traceback (most recent call last):
File "fb2cal.py", line 813, in
main()
File "fb2cal.py", line 126, in main
c = populate_birthdays_calendar(birthdays)
File "fb2cal.py", line 782, in populate_birthdays_calendar
c._unused.append(ics.parse.ContentLine(name='X-WR-CALNAME', params={}, value='Facebook Birthdays (fb2cal)'))
AttributeError: 'Calendar' object has no attribute '_unused'

Syntax error when I run fb2cal.py

At this point of the setup process - https://youtu.be/UnsbV8EJ8-Y?t=259
I get the following error -

 File "src/fb2cal.py", line 73
    CONFIG_FILE_PATH = f'../config/{CONFIG_FILE_NAME}'
                                                     ^
SyntaxError: invalid syntax

Using Python 3.7.3, requirements.txt modules installed. On V1.0.3 - Point Release of the repo.

Has anyone faced this issue?

KeyError: 'LOGGING'

PS C:\Users\jonic\Desktop\fb2cal-master_1.0.2\fb2cal-master\src> python .\fb2cal.py
[2019-08-02 19:45:27,926] fb2cal INFO () Starting fb2cal v1.0.2 (Production) [https://git.io/fjMwr]
[2019-08-02 19:45:27,926] fb2cal INFO () This project is released under the GPLv3 license.
[2019-08-02 19:45:27,926] fb2cal INFO (main) Attemping to parse config file config.ini...
[2019-08-02 19:45:27,927] fb2cal INFO (main) Config successfully loaded.
Traceback (most recent call last):
File ".\fb2cal.py", line 732, in
main()
File ".\fb2cal.py", line 82, in main
logger.setLevel(getattr(logging, config['LOGGING']['level']))
File "C:\Users\jonic\AppData\Local\Programs\Python\Python37\lib\configparser.py", line 958, in getitem
raise KeyError(key)
KeyError: 'LOGGING'

ERROR (parse_birthday_day_month)

Heya!

I live in Finland and our language doesn't really work well with any code or system unfortunately.

I got error message stating the following:
fb2cal ERROR (parse_birthday_day_month) Failed to parse birthday day/month. Parse failed with tooltip_content: "Firstname Lastname (torstai)", locale: "fi_FI". Day name "torstai" is not in the offset dict {'maanantaina': 1, 'tiistaina': 2, 'keskiviikkona': 3, 'torstaina': 4, 'perjantaina': 5, 'lauantaina': 6, 'sunnuntaina': 7}

Basically the ending "na" could be left out and I'd be happy.

Is there any way I can force certain locale like en_GB for the output file because it'd be OK for me to have those birthdays in English. Or do you have any other suggestions?

Incomplete composer query response for get_entity_id_from_vanity_name

In get_entity_id_from_vanity_name I was frequently getting an empty list back in json_response['payload']['entries'], so I inspected the json and noticed the lid key. I tried using that when there weren't any 'entries', and everything worked like magic - something like:

    if not json_response['payload']['entries']:
        return json_response['lid']

Not sure if anyone else is having this issue, but thought I would post anyway.

Thanks so much for creating this!

Stuck at step 6

First off thanks for the tool.
Second: I'm NOT a dev, nor anything like that. But can follow (easy and simple) steps.
Third: Working on a Mac.
Fourth: Did everything that was explained in the Readme file and ended up with the following upon starting step 6 (Run script manually once for testing purposes: python ....../src/fb2cal.py)

File "src/fb2cal.py", line 60
    return f'{self.name} ({self.day}/{self.month})'
                                                  ^
SyntaxError: invalid syntax

Did I do something wrong or is it just that Mac ain't supported? Want to create the file once only, not as a regular thing. Stopped Facebook-2FA for this procedure before starting with the first step.
Thanks for any help!

Use infopage async endpoint to fetch birthdays

The 'about me' section of a user also shows the birthday in full format alongside the year:

Endpoint:
https://www.facebook.com/profile/async/infopage/nav/

This could potentially be used a faster approach.
However, you'd need to get a list of Facebook friends, iterate over them all, check the field.

Avoid throwing exception if credentials.json is missing

Instead throw a nicer error message.

C:\Python36\lib\site-packages\oauth2client\_helpers.py:255: UserWarning: Cannot access token.json: No such file or directory
  warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Traceback (most recent call last):
  File "C:\Python36\lib\site-packages\oauth2client\clientsecrets.py", line 121, in _loadfile
    with open(filename, 'r') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'credentials.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\mobeigi\Desktop\fb2cal\src\fb2cal.py", line 362, in <module>
    main()
  File "c:\Users\mobeigi\Desktop\fb2cal\src\fb2cal.py", line 53, in main
    service = google_api_authenticate()
  File "c:\Users\mobeigi\Desktop\fb2cal\src\fb2cal.py", line 127, in google_api_authenticate
    flow = client.flow_from_clientsecrets('credentials.json', SCOPES)
  File "C:\Python36\lib\site-packages\oauth2client\_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\Python36\lib\site-packages\oauth2client\client.py", line 2135, in flow_from_clientsecrets
    cache=cache)
  File "C:\Python36\lib\site-packages\oauth2client\clientsecrets.py", line 165, in loadfile
    return _loadfile(filename)
  File "C:\Python36\lib\site-packages\oauth2client\clientsecrets.py", line 125, in _loadfile
    exc.strerror, exc.errno)
oauth2client.clientsecrets.InvalidClientSecretsError: ('Error opening file', 'credentials.json', 'No such file or directory', 2)

Unknown error

C:\Git\fb2cal\fb2cal\src>python ./fb2cal.py
C:\Users\Home\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client_helpers.py:255: UserWarning: Cannot access token.json: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Traceback (most recent call last):
File "./fb2cal.py", line 386, in
main()
File "./fb2cal.py", line 72, in main
service = google_api_authenticate()
File "./fb2cal.py", line 151, in google_api_authenticate
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)
File "C:\Users\Home\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "C:\Users\Home\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client\client.py", line 2135, in flow_from_clientsecrets
cache=cache)
File "C:\Users\Home\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client\clientsecrets.py", line 165, in loadfile
return _loadfile(filename)
File "C:\Users\Home\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client\clientsecrets.py", line 126, in _loadfile
return _validate_clientsecrets(obj)
File "C:\Users\Home\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client\clientsecrets.py", line 101, in _validate_clientsecrets
prop_name, client_type))
oauth2client.clientsecrets.InvalidClientSecretsError: Missing property "redirect_uris" in a client type of "web".

Facebook Checkpoint Error

After giving the access manually n number of times, I'm still having the checkpoint issue from Facebook. How to register myself in the trusted device so to skip this error?
image
image

Accented characters

I have this strange error: if I open google calendar on pc accented characters are displayed correctly, but in samsung calendar on my galaxy s8 I see "&#xf2" instead of "ò".
How can I solve this issue?

Authentication error with special characters in a password

Hi.

I was struggling to make it work, getting Failed to authenticate with Facebook with email ***@gmail.com. Please check provided email/password. Re-checked the credentials multiple times and found out what's going on only after printing the password to a console.

I have the following symbols in my password – %%, which were recognized as % by the script. After changing it in the config to %%%% I was able to proceed. Not sure if this is the case with other special characters, but that's how it is with percent one.

Exception thrown upon first time Google API authentication

Upon authorizing Google Drive API (first time), an exception is still thrown even if script continunes to execute with no issues till the end.

Example:

[Running] py -3 "c:\Users\mobeigi\Desktop\fb2cal\src\fb2cal.py"
C:\Python36\lib\site-packages\oauth2client\_helpers.py:255: UserWarning: Cannot access token.json: No such file or directory
  warnings.warn(_MISSING_FILE_MESSAGE.format(filename))

Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?client_id=<REDACTED>

If your browser is on a different machine then exit and re-run this
application with the command-line parameter

  --noauth_local_webserver

Authentication successful.

[Done] exited with code=0 in 170.441 seconds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.