linkedin-api 2.3.0__tar.gz → 2.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: linkedin-api
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: LinkedIn API for Python
5
5
  Home-page: https://github.com/tomquirk/linkedin-api
6
6
  License: MIT
@@ -26,7 +26,7 @@ Description-Content-Type: text/markdown
26
26
 
27
27
  # LinkedIn API for Python
28
28
 
29
- ![Build](https://img.shields.io/github/actions/workflow/status/tomquirk/linkedin-api/ci.yml?label=Build&logo=github) [![Documentation](https://img.shields.io/readthedocs/linkedin-api?label=Docs)](https://linkedin-api.readthedocs.io) [![GitHub Release](https://img.shields.io/github/v/release/tomquirk/linkedin-api?label=PyPI&logo=python)](https://pypi.org/project/linkedin-api/) [![Discord](https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=ffffff)](https://discord.gg/9w5c6xzm)
29
+ ![Build](https://img.shields.io/github/actions/workflow/status/tomquirk/linkedin-api/ci.yml?label=Build&logo=github) [![Documentation](https://img.shields.io/readthedocs/linkedin-api?label=Docs)](https://linkedin-api.readthedocs.io) [![GitHub Release](https://img.shields.io/github/v/release/tomquirk/linkedin-api?label=PyPI&logo=python)](https://pypi.org/project/linkedin-api/) [![Discord](https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=ffffff)](https://discord.gg/hdd48NEB37)
30
30
 
31
31
  Search profiles, send messages, find jobs and more in Python. No official API access required.
32
32
 
@@ -94,7 +94,7 @@ And more! [Read the docs](https://linkedin-api.readthedocs.io/en/latest/api.html
94
94
  pip install linkedin-api
95
95
  ```
96
96
 
97
- Or, for bleading edge:
97
+ Or, for bleeding edge:
98
98
 
99
99
  ```bash
100
100
  pip install git+https://github.com/tomquirk/linkedin-api.git
@@ -2,7 +2,7 @@
2
2
 
3
3
  # LinkedIn API for Python
4
4
 
5
- ![Build](https://img.shields.io/github/actions/workflow/status/tomquirk/linkedin-api/ci.yml?label=Build&logo=github) [![Documentation](https://img.shields.io/readthedocs/linkedin-api?label=Docs)](https://linkedin-api.readthedocs.io) [![GitHub Release](https://img.shields.io/github/v/release/tomquirk/linkedin-api?label=PyPI&logo=python)](https://pypi.org/project/linkedin-api/) [![Discord](https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=ffffff)](https://discord.gg/9w5c6xzm)
5
+ ![Build](https://img.shields.io/github/actions/workflow/status/tomquirk/linkedin-api/ci.yml?label=Build&logo=github) [![Documentation](https://img.shields.io/readthedocs/linkedin-api?label=Docs)](https://linkedin-api.readthedocs.io) [![GitHub Release](https://img.shields.io/github/v/release/tomquirk/linkedin-api?label=PyPI&logo=python)](https://pypi.org/project/linkedin-api/) [![Discord](https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=ffffff)](https://discord.gg/hdd48NEB37)
6
6
 
7
7
  Search profiles, send messages, find jobs and more in Python. No official API access required.
8
8
 
@@ -70,7 +70,7 @@ And more! [Read the docs](https://linkedin-api.readthedocs.io/en/latest/api.html
70
70
  pip install linkedin-api
71
71
  ```
72
72
 
73
- Or, for bleading edge:
73
+ Or, for bleeding edge:
74
74
 
75
75
  ```bash
76
76
  pip install git+https://github.com/tomquirk/linkedin-api.git
@@ -1436,25 +1436,29 @@ class Linkedin(object):
1436
1436
  # We extract the last part of the string
1437
1437
  profile_urn = profile_urn_string.split(":")[-1]
1438
1438
 
1439
- trackingId = generate_trackingId()
1440
1439
  payload = {
1441
- "trackingId": trackingId,
1442
- "message": message,
1443
- "invitations": [],
1444
- "excludeInvitations": [],
1445
1440
  "invitee": {
1446
- "com.linkedin.voyager.growth.invitation.InviteeProfile": {
1447
- "profileId": profile_urn
1448
- }
1441
+ "inviteeUnion": {"memberProfile": f"urn:li:fsd_profile:{profile_urn}"}
1449
1442
  },
1443
+ "customMessage": message,
1444
+ }
1445
+ params = {
1446
+ "action": "verifyQuotaAndCreateV2",
1447
+ "decorationId": "com.linkedin.voyager.dash.deco.relationships.InvitationCreationResultWithInvitee-2",
1450
1448
  }
1449
+
1451
1450
  res = self._post(
1452
- "/growth/normInvitations",
1451
+ "/voyagerRelationshipsDashMemberRelationships",
1453
1452
  data=json.dumps(payload),
1454
1453
  headers={"accept": "application/vnd.linkedin.normalized+json+2.1"},
1454
+ params=params,
1455
1455
  )
1456
-
1457
- return res.status_code != 201
1456
+ # Check for connection_response.status_code == 400 and connection_response.json().get('data', {}).get('code') == 'CANT_RESEND_YET'
1457
+ # If above condition is True then request has been already sent, (might be pending or already connected)
1458
+ if res.ok:
1459
+ return False
1460
+ else:
1461
+ return True
1458
1462
 
1459
1463
  def remove_connection(self, public_profile_id: str):
1460
1464
  """Remove a given profile as a connection.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "linkedin-api"
3
- version = "2.3.0"
3
+ version = "2.3.1"
4
4
  description = "LinkedIn API for Python"
5
5
  authors = ["Tom Quirk <tom@codalabs.au>"]
6
6
  maintainers = ["Tom Quirk <tom@codalabs.au>"]
File without changes