Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update "Last Update (Timestamp)" Column Dynamically When Quota is Reached #127

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
edcc6e2
Create New AddDays Column
davisjk Mar 30, 2024
76ff90d
Reorganize declarations
davisjk Mar 30, 2024
eb7c228
Undo minor change I decided not to use
davisjk Mar 30, 2024
c27050a
Undo a couple more things that accidentally got removed
davisjk Mar 30, 2024
9040be6
umm
davisjk Mar 31, 2024
fe99ee6
Finished updating methods to find videos in channels and playlists ho…
davisjk Mar 31, 2024
86e5094
Auto-formatted document cause whitespace was driving me crazy
davisjk Mar 31, 2024
002d25c
Replace redundant code
davisjk Mar 31, 2024
dd1e0e5
Fixed exception I was seeing and also updated the last update timesta…
davisjk Mar 31, 2024
6b296a2
Update README with new column info
davisjk Mar 31, 2024
7a7757c
Fix an error with setting and updating dates from spreadsheet to do w…
davisjk Mar 31, 2024
0506385
Decouple addTime and nextTimeDiff
davisjk Mar 31, 2024
00a9cd6
Revert README updates in prep for removing "new" column
davisjk Apr 2, 2024
82c4674
get rid of max days to add column and update getting video ids but st…
davisjk Apr 2, 2024
09471ce
Fix minor errors with changing list of vid ids to list of vid snippets
davisjk Apr 2, 2024
fea2eb0
Fixing some more small errors with changing to a list of metadata
davisjk Apr 2, 2024
1d5c346
handle exceeded quota more gracefully
davisjk Apr 10, 2024
3c793b3
Removing error
davisjk Apr 10, 2024
6c43a61
Code checking errors for exceeded quota wasn't parsing json correctly
davisjk Apr 11, 2024
b3ee38b
Add # and quota stuff to README
davisjk Apr 11, 2024
f92c916
Fix deleting duplicates and make deleting a little more optimized and…
davisjk Apr 11, 2024
7ab65d2
Add note about deleting duplicates
davisjk Apr 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@ This is done using Google Sheets for interface, Google Script + Youtube API v3 f

### Features

- Add all new videos to Youtube playlists (uploaded later than some date);

- Add all new videos to Youtube playlists;
- uploaded later than some date & time
- if daily quota is exceeded, this automatically picks up where it left off on the next execution;
- from all subscribed channels;

- from any list of channels (by channel ID);

- from any other playlist (by playlist ID);

- Set automatic interval for updates (optional);

- Deploy as a web app to update or show playlist (optional);

- Remove videos in the playlists that are older than a certain number of days before the execution of the script (optional).

- simultaneously removes duplicates
- Remove videos less than 1 minute in length (e.g. shorts) (optional)

### (Extra) Scripts to easily remove multiple items from a youtube playlist [here](./removeVidsFromPlaylist.md)
Expand All @@ -41,7 +37,7 @@ If you ran into problems, here are some of the possible sources for solutions:
1. [Copy](http://bit.ly/subscriptionPlaylistsCopy) the Sheet to your Google Drive.
Afterwards you might want to update the script to the latest version of sheetScript.gs

2. Setup your playlists and channels (white cells in the Sheet):
1. Setup your playlists and channels (white cells in the Sheet):
- Clear all existing white rows, they are just examples (i.e. delete the 3 rows).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need a larger indent here, seems like it's resetting the ordered list count
image

- For each new playlist you want to use:
- In a new row:
Expand All @@ -57,11 +53,11 @@ If you ran into problems, here are some of the possible sources for solutions:
- Optionally add a number of days in column D. Videos in the playlist that have been published that many days before are going to be removed from the playlist.
- Optionally add `No` to column E to remove all new videos under 1 minute in length from being added to the playlist.

3. Run the script:
1. Run the script:
- In Sheet's menu: `YouTube Controls` / `Update Playlists`
- Grant access in the dialog

4. (Optional) Adjust Timezone:
1. (Optional) Adjust Timezone:
- In menu (of the Sheet): `Extensions` / `Apps Script`
- If you don't see an `appsscript.json` file in the editor, got to `Project Settings` tab and select `
Show "appsscript.json" manifest file in editor`
Expand All @@ -79,27 +75,27 @@ Show "appsscript.json" manifest file in editor`
##### Scheduled playlist update:

1. In menu (of the Sheet): `Extensions` / `Apps Script`
2. Go to `Triggers` tab
3. Press the blue button in the lower right corner `+ Add Trigger`
4. Select `updatePlaylists` -> `Head` -> `Time driven` -> `Hour timer` -> `Every hour`
5. `Save`
1. Go to `Triggers` tab
1. Press the blue button in the lower right corner `+ Add Trigger`
1. Select `updatePlaylists` -> `Head` -> `Time driven` -> `Hour timer` -> `Every hour`
1. `Save`

##### Deploy as a web app:

1. In menu (of the Sheet): `Extensions` / `Apps Script`
1. Click on `Deploy` -> `New Deployment`
1. Use the cog beside `Select type`. Ensure `web app` is selected.
4. Click `Deploy` (you will get a special link to use)
5. Optional - create a tiny.cc redirect link for easy acess (tiny.cc is recommended as it allows you to pass parameters to the url)
6. Usage: append `?pl=N` to select the Nth playlist in the spreadsheet.
1. Click `Deploy` (you will get a special link to use)
1. Optional - create a tiny.cc redirect link for easy acess (tiny.cc is recommended as it allows you to pass parameters to the url)
1. Usage: append `?pl=N` to select the Nth playlist in the spreadsheet.
- append `?update=True` to force update all the playlists.
- e.g. `tiny.cc/myplaylist?update=True&pl=3` will force update and open the third playlist.

# Update script

Often, changes will be made to the script which you will need to add to your copy of the sheet. There are two ways to do this:
1. Get a new [copy](http://bit.ly/subscriptionPlaylistsCopy) of the sheet and copy your data from your old one to the new one
2. Edit the script in your existing sheet:
1. Edit the script in your existing sheet:
- In menu (of the sheet) click on: `Extensions` / `Apps Script`
- Replace the script (Code.gs) with the new script found [here](./sheetScript.gs)

Expand Down Expand Up @@ -158,6 +154,10 @@ In the sheet, channel usernames and custom URLs cannot be used, only channel ids

A: Copy-paste the contents of the debug.gs file into your Script Editor

##### Q: I want to temporarily stop updating one playlist but I don't want to have to delete everything in that row

A: Add a `#` before the playlist in column A that you want to stop updating. The script ignores rows without a playlist or playlists that start with `#`. For example: `PLCiNIjl_KpQhFwQA3G19w1nmhEOlZQsGF` would become `#PLCiNIjl_KpQhFwQA3G19w1nmhEOlZQsGF`

##### Q: I have more questions.

A: See `Feedback` section below.
Expand Down