Skip to content

Commit

Permalink
fix: stdout can be 'null' (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats authored Sep 18, 2023
1 parent 992702d commit 92150fe
Show file tree
Hide file tree
Showing 9 changed files with 313 additions and 271 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: cron

on:
schedule:
# Cron job every day at 12:00
# https://crontab.guru/#0_12_*_*_*
- cron: '0 0 * * *'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true
- name: Test
run: pnpm test
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install
run: npm install --no-package-lock
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true
- name: Test
run: npm test
run: pnpm test
- name: Report
run: mkdir -p coverage && npx c8 report --reporter=text-lcov > coverage/lcov.info
- name: Coverage
Expand All @@ -63,4 +66,4 @@ jobs:
git config --global user.email ${{ secrets.GIT_EMAIL }}
git config --global user.name ${{ secrets.GIT_USERNAME }}
git pull origin master
npm run release
pnpm run release
9 changes: 6 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install
run: npm install --no-package-lock
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true
- name: Test
run: npm test
run: pnpm test
- name: Report
run: mkdir -p coverage && npx c8 report --reporter=text-lcov > coverage/lcov.info
- name: Coverage
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ youtubedl('https://www.youtube.com/watch?v=6xKWiCMKKJg', {
noCheckCertificates: true,
noWarnings: true,
preferFreeFormats: true,
addHeader: [
'referer:youtube.com',
'user-agent:googlebot'
]

addHeader: ['referer:youtube.com', 'user-agent:googlebot']
}).then(output => console.log(output))
```

Expand Down Expand Up @@ -121,9 +117,12 @@ Similar to main method but instead of a parsed output, it will return the intern
const youtubedl = require('youtube-dl-exec')
const fs = require('fs')

const subprocess = youtubedl.exec('https://www.youtube.com/watch?v=6xKWiCMKKJg', {
dumpSingleJson: true
})
const subprocess = youtubedl.exec(
'https://www.youtube.com/watch?v=6xKWiCMKKJg',
{
dumpSingleJson: true
}
)

console.log(`Running subprocess as ${subprocess.pid}`)

Expand Down
Loading

0 comments on commit 92150fe

Please sign in to comment.