项目作者: ghostops

项目描述 :
ICloud Shared Album is a library for scraping data off public icloud shared albums.
高级语言: TypeScript
项目地址: git://github.com/ghostops/ICloud-Shared-Album.git
创建时间: 2020-08-23T11:38:11Z
项目社区:https://github.com/ghostops/ICloud-Shared-Album

开源协议:

下载


ICloud Shared Album 📸

ICloud Shared Album is a library for scraping data off public icloud shared albums. Heavily utilization of bertrandom/icloud-shared-album-to-flickr, thanks for the great starting point!

Installation

  1. npm install -s icloud-shared-album

Usage

Apple uses CORS protection for the iCloud library API endpoints. Recommended use is server-side to avoid any CORS related errors.

  1. import { getImages } from 'icloud-shared-album';
  2. const data = await getImages('YOUR_ALBUM_TOKEN');
  3. console.log(data);

You can obtain your ICloud album token from the public URL.

  1. https://www.icloud.com/sharedalbum/#B0z5qAGN1JIFd3y
  2. ^^^^^^^^^^^^^^^

The string behind the hash will be your token.

CLI Usage

The CLI will output the data in JSON if successful.

  1. npx icloud-shared-album $TOKEN

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Changelog

Changes in v1.2.1

Fixed a bug caused by Apple redirecting the requests: https://github.com/ghostops/ICloud-Shared-Album/issues/6

Changes in v1.2.0

Duplicate derivatives are now handled with an incrementing index:

  1. derivatives: {
  2. '720': {
  3. checksum: 'string',
  4. fileSize: 1000,
  5. width: 50,
  6. height: 720,
  7. url: 'https://...',
  8. },
  9. '720-1': {
  10. checksum: 'string',
  11. fileSize: 5000,
  12. width: 500,
  13. height: 720,
  14. url: 'https://...',
  15. },
  16. '720-2': {
  17. checksum: 'string',
  18. fileSize: 10000,
  19. width: 5000,
  20. height: 720,
  21. url: 'https://...',
  22. }
  23. }

Breaking changes in v1.1.0

We now return the metadata associated with an album in addition to an array of images. The response from getImages now looks like this:

  1. {
  2. metadata: {
  3. streamName: 'string',
  4. userFirstName: 'string',
  5. userLastName: 'string',
  6. streamCtag: 'string',
  7. itemsReturned: 0,
  8. locations: {},
  9. },
  10. photos: [{ ...'same as before' }],
  11. }

Breaking changes in v1.0.0

The bestDerivative and url variables have been removed. Instead the variable url has been added to the Derivative object. The key to the derivative is the height of the image, just like in the response from ICloud.

Previously:

  1. {
  2. url: 'https://...',
  3. bestDerivative: {
  4. checksum: 'string',
  5. fileSize: 'number',
  6. width: 'number',
  7. height: 'number',
  8. }
  9. }

Now:

  1. {
  2. derivatives: {
  3. '100': {
  4. checksum: 'string',
  5. fileSize: 1000,
  6. width: 50,
  7. height: 100,
  8. url: 'https://...',
  9. },
  10. '1234': {
  11. checksum: 'string',
  12. fileSize: 5000,
  13. width: 500,
  14. height: 1234,
  15. url: 'https://...',
  16. }
  17. }
  18. }

License

MIT